Annapurna1
Contributor III
2022-05-24
09:15 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using nested if conditions
Hi All,
How to use if condition for the below SQL Code
case when b.tenure between 0 and 12 then 'a 0-12'
when b.tenure between 13 and 18 then 'b 13-18'
when b.tenure between 19 and 24 then 'c 19-24'
when b.tenure between 25 and 30 then 'd 25-30'
when b.tenure between 31 and 36 then 'e 31-36'
when b.tenure > 36 then 'f > 36 'else 'z missing' end as Tenure_Bucket
Thanks in Advance.
352 Views
1 Solution
Accepted Solutions
marcus_sommer
MVP
2022-05-24
09:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe with:
if(Field <= 12, 'a', if(Field <= 18, 'b', ...., 'z'))))))
- Marcus
337 Views
1 Reply
marcus_sommer
MVP
2022-05-24
09:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe with:
if(Field <= 12, 'a', if(Field <= 18, 'b', ...., 'z'))))))
- Marcus
338 Views