- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Assign a "bin" value based on odd or even value in another column
Is it possible to assign a "bin" value based on the number being odd or even. The attached table already has a bin column but i am trying to split this pick list up and making every other part a different bin
Thanks
Even = 1
Odd = 2
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assign a "bin" value based on odd or even value in another column
Assuming that column SeqNo is the column you want to have the odd and even binning based on the formula for the bin_2 is:
mod( :SeqNo, 2 ) +1;
Mod, or Modulo returns the remainder from dividing the first value by the second value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assign a "bin" value based on odd or even value in another column
Assuming that column SeqNo is the column you want to have the odd and even binning based on the formula for the bin_2 is:
mod( :SeqNo, 2 ) +1;
Mod, or Modulo returns the remainder from dividing the first value by the second value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Assign a "bin" value based on odd or even value in another column
txnelson beat me to it! Anyway, I attached my version of his solution using the mod function, assuming you wanted to do this by row number. Of course, you could use any other numeric value to spit by odd/even this way.