on 03-18-2016 3:35 PM
I have a Calculated Column I am trying to create in a Calculation View where I am using an IF Statement to calculate Day Buckets based on a Decimal Column called DAYS with the Syntax below;
if("DAYS"<1.5,'Less than 1 day',
if("DAYS"<3.5,'Less than 3 days',
if("DAYS"<5.5,'Less than 5 days',
if("DAYS"<7.5,'Less than 7 days',
if("DAYS">=7.5,'> 7 days',
'No Info Provided')))))
Currently this logic is only returning results as '> 7 days', and the DAYS Column definitely has numbers below 7.5 in my data, so all of the other Text Fields should be getting populated with results.
Is there any reason why this would be the case? Would I need to change the logic to a CASE Statement instead, or convert the DAYS Column from a Decimal to something else?
Hi,
Please use casting for day field. Cast it into INT. please check below example.
if((int("DAY")<1.5,'Less than 1 day'
.
.
.
.
.
.
.
'No info Provided')
I hope, this will help you.
-Vikram Divekar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
There could be a possibility that the column "DAYS" might be getting aggregated.
if(decfloat("DAYS")<1.5,'Less than 1 day',
if(decfloat("DAYS")<3.5,'Less than 3 days',
if(decfloat("DAYS")<5.5,'Less than 5 days',
if(decfloat("DAYS")<7.5,'Less than 7 days',
if(decfloat("DAYS")>=7.5,'> 7 days',
'No Info Provided')))))
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andrew,
a CASE would not fit your requirement, because the CASE function supports only a simple case at the moment (only a = comparsion possible).
I tested your IF on a SPS10 system and it works w/o problems.
Did you check maybe the result with the data preview function (which limits the recoreds) which returned only records fitting to the "> 7 days" category?
Regards,
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.