Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Gartner® Magic Quadrant™: 15 YEARS A LEADER - GET THE REPORT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested IF Statement in Pivot Table

Can I use Nested IF statements in pivots table to show different data depending on what value a particular field show.

I have a standard if statement working, but have three possible values hence the requirement for nested which I can't seem to get to work.

Working IF Statement

if(component_make_or_buy='M',rangesum(wo_quantity_remaining),rangesum(sum(po_qty_ordered)-sum(po_qty_received)))

Non working Nested IF Statement

if(component_make_or_buy='M',rangesum(wo_quantity_remaining),if(component_make_or_buy='B',rangesum(sum(po_qty_ordered)-sum(po_qty_received)))

I know there are only two elements above but I planned to add the third once this was working.






1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Your second expression with the nested IF() is missing a closing parenthesis. You will also want to be careful to insure that the field you are testing (component_make_or_buy) can only have a single value at any time or the expression will return null.

View solution in original post

3 Replies
Anonymous
Not applicable
Author

Your second expression with the nested IF() is missing a closing parenthesis. You will also want to be careful to insure that the field you are testing (component_make_or_buy) can only have a single value at any time or the expression will return null.

Anonymous
Not applicable
Author

Hi.

Technically, there is no problem to use nested if's in Pivotable, we've done it.

However, it will be a lot more performant to do those calculations in your loading script (btw, it will be more readeable to the user too, when creating new objects).

Best regards,

Miguel Catalao

Not applicable
Author

Thanks, it was just that missing bracket.