Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
we are trying a simple IF expression, we are not getting an error with the syntax but the results will not load.
It is simply:
if(Sum(Cases*-1>80),'80-100',if(Sum(Cases*-1>60),'60-80', 0))
We have tried numberous different expressions but cant seem to get it.
We are trying to group the values of the cases into sub groups of ranges.
The Cases value on the file is negative, thats why we are mulitplying by -1.
Thanks,
Gregg
HI
Try like this
Dublin:
Load * from HeatMap.xls;
inner join(Dublin)
Load Product,
f(Sum(Cases)*-1>80,'80-100',
if(Sum(Cases)*-1>60,'60-80', 0)) as FieldName
resident Dublin group by Product;
whenever you use aggregation function like sum(),you must use group by clause .
Hope it helps
Hi
if(Sum(Cases)*-1>80,'80-100',
if(Sum(Cases)*-1>60,'60-80', 0))
use this expression
Hi,
I have tried this expression before and I just tried it again to be sure but still no joy.
Thanks,
Gregg
Hi Gregg,
It works for me, the expression is right. Can you post an example?
thanks,
Rajesh Vaswani
Hello
i tried below expr it work to me
if(sum(sal)*-2*-1>=10000,sal,
if(sum(sal)*-3*-1>=20000,sal,0))
same as above expr it works check the syntax
Hi,
Use this script
if(Sum(Cases)*-1<80,'80-100',
if(Sum(Cases)*-1<60,'60-80', 0))
Because your values going negative.
Regards,
Anand
Hi,
I tried it in the script also and got the attached error when loading.
I was trying it as an expression in a list box previously.
Regards,
Gregg
HI
Try like this
Dublin:
Load * from HeatMap.xls;
inner join(Dublin)
Load Product,
f(Sum(Cases)*-1>80,'80-100',
if(Sum(Cases)*-1>60,'60-80', 0)) as FieldName
resident Dublin group by Product;
whenever you use aggregation function like sum(),you must use group by clause .
Hope it helps
Hi,
Thanks that worked.
Do you load product again to beacuse the cases are of certain products?
And the group by statement is used because we need them grouped into different categories, e.g. (80 - 100)
I just want to understand so I know for future expressions.
Thanks,
Gregg