Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, can i use sumif in the scripts? I used the following in the scripts but i got an error in expression..
sum(if((QuarterID - 12),Revenue) as NewRevenue
Thanks!
Bracket is missing in your statement
sum(if((QuarterID - 12),Revenue)) as NewRevenue
something like that
sum(if(QuarterID - 12 = 0,0,Revenue)) as NewRevenue
with this test data
a:
load * inline [
Year,Quarter,Revenue
2010,1,100
2010,2,100
2010,3,100
2010,4,100
2011,1,100
2011,2,100
2011,3,100
2011,4,100
];
you can have this script
load
*,
if(Quarter=12,Revenue,0) as NewRevenue
Resident a;
or this
load
Year,
sum(if(Quarter=12,Revenue,0)) as NewRevenue
Resident a
group by Year;
Bracket is missing in your statement
sum(if((QuarterID - 12),Revenue)) as NewRevenue
Thanks!