Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to group some shipment data by weight range in a Straight table, however I can only get it to work partially.
At the moment I am using an IF function like this:
=If(SHP_WEIGHT <=0.50, '0.5KG',
If(SHP_WEIGHT >>0.50<=1.00, '1KG',
If(SHP_WEIGHT >>1.01<=2.00, '2KG',
If(SHP_WEIGHT >>2.01<=3.00, '3KG',
If(SHP_WEIGHT >>3.01<=4.00, '4KG',
'unknown')))))
This is not giving me the result I need.
The 2KG range now shows from 2.00 up to 6.00 and the 3KG range shows for 6.00 up to 16.00.
How can I fix this?
Definitely, we are missing Aggr here...
Something like
Aggr(
If(SHP_WEIGHT <=0.50, '0.5KG',
If(SHP_WEIGHT >0.50<=1.00, '1KG',
If(SHP_WEIGHT >1.00<=2.00, '2KG',
If(SHP_WEIGHT >2.00<=3.00, '3KG',
If(SHP_WEIGHT >3.00<=4.00, '4KG',
'unknown'))))),Shipment)
Expression
COUNT(Distinct Shipment)
=If(SHP_WEIGHT <=0.50, '0.5KG',
If(SHP_WEIGHT >0.50<=1.00, '1KG',
If(SHP_WEIGHT >1.00<=2.00, '2KG',
If(SHP_WEIGHT >2.00<=3.00, '3KG',
If(SHP_WEIGHT >3.00<=4.00, '4KG',
'unknown')))))
Class() would be a better option.
Hi Manisch,
I'm afraid your suggeestion is not working for me, I am not allowed to use the single ">" option, does this mean there is something wrong with the data?
Definitely, we are missing Aggr here...
Something like
Aggr(
If(SHP_WEIGHT <=0.50, '0.5KG',
If(SHP_WEIGHT >0.50<=1.00, '1KG',
If(SHP_WEIGHT >1.00<=2.00, '2KG',
If(SHP_WEIGHT >2.00<=3.00, '3KG',
If(SHP_WEIGHT >3.00<=4.00, '4KG',
'unknown'))))),Shipment)
Expression
COUNT(Distinct Shipment)
use class function for this,but in this case u will get fixed range,
Thanks