Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have 4 fields Class1, Class2, Class3, and Class4 with ID.
I want to filter into 3 buckets based on their values.
If Class1 or Class2 or Class3 or Class4 if greater than 30, then ID as 30+ID,
similarly for other numeric values like 59, 100 etc..
But the if statement i use is not accurate enough and giving all the IDs as result.
Can someone pls look here.
It will be a great help.
I think the second suggestion by swuehl using the RangeMax() is the best idea.
Try something like this instead for your If's:
If((Class1 > 30 or Class2 > 30 or Class3 > 30 or Class4 > 30), ID) as [30+ ID],
If((Class1 > 30 or Class2 > 30 or Class3 > 30 or Class4 > 34), ID) as [34+ ID],
If((Class1 > 30 or Class2 > 30 or Class3 > 30 or Class4 > 52), ID) as [52+ ID],
If((Class1 > 30 or Class2 > 30 or Class3 > 30 or Class4 > 104), ID) as [104+ ID]
You need to write your condition like
If( (Class1 >30 or Class2 >30 or Class3 > 30 or Class4 > 30), ID) as [30+ ID],
or
if( RangeMax(Class1, Class2, Class3, Class4) >30, ID) as [30+ ID]
Try like this
If((Class1 > 30 or Class2 > 30 or Class3> 30 or Class4 > 30), ID) as [30+ ID],
If((Class1> 34 or Class2> 34 or Class3> 34 or Class4 > 34), ID) as [34+ ID],
If((Class1> 52 or Class2> 52 or Class3> 52 or Class4 > 52), ID) as [52+ ID],
If((Class1> 104 or Class2> 104 or Class3 > 104or Class4 > 104), ID) as [104+ ID]
I think the second suggestion by swuehl using the RangeMax() is the best idea.
Thanq Mr. Bill.
It's working.
Thanq Mr. Avinash,
It's working. I learnt a new thing today.
Thanq
This worked too.