Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
apthansh
Contributor

Nested if in load script error

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 ?

1 Solution

Accepted Solutions

Re: Nested if in load script error

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;

View solution in original post

4 Replies

Re: Nested if in load script error

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;

View solution in original post

apthansh
Contributor

Re: Nested if in load script error

How Silly..I just missed the if !!

Thank you very much.You are a rockstar !!

Re: Nested if in load script error

You didn't miss an if... but you had an extra Sum()

apthansh
Contributor

Re: Nested if in load script error

Yup !!