Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Load,
[ ID Key],
CPKey,
Sum(IF(sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm)) <=0,
sum(if(CPYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),CommPlan)),
sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm)))) as SF
Resident SF
Group by [ID Key],
CPKey;
Drop Table SF;
I a using the above script and I am getting error saying cannot do nested aggregation is not allowed ? Cant I do it or I am doing something wrong here ?
May be this
LOAD [ ID Key],
CPKey,
If(Sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm)) <= 0,
Sum(if(CPYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()), CommPlan)),
Sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm))) as SF
Resident SF
Group by [ID Key], CPKey;
DROP Table SF;
May be this
LOAD [ ID Key],
CPKey,
If(Sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm)) <= 0,
Sum(if(CPYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()), CommPlan)),
Sum(if(CYQ='Q'&ceil(Month(Today())/3)&'_'& year(Today()),Comm))) as SF
Resident SF
Group by [ID Key], CPKey;
DROP Table SF;
How Silly..I just missed the if !!
Thank you very much.You are a rockstar !!
You didn't miss an if... but you had an extra Sum()
Yup !!