Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

If Statement Set Analysis Evaluation Order Error

I'm trying to create a view of a P&L that compares the selected level of review (for example, a 'Region' within the company) against the parent. In this case, 'Region' rolls up to 'Area' and 'Area' rolls to 'Company'. I've written the variable below to try to create this and I'm getting a 0 value when Qlikview is evaluating it. I'm not advanced enough to know how Qlik evaluates the formula, so if anyone can help me figure this out I'd appreciate it.

SET vPLActualAmountYTD1 =

  If($(vAreaReview) = 1, //vAreaReview evaluates the current selections to determine which parent to display

  SUM({1<[Company] = {'$(vCompany)'}, [FiscYTDAcctgFlag]={1}>} ActualAmount), //If we are reviewing at the Area level, calculate the amount at the Company level (Area rolls to Company)

  SUM({1<[Area] = {'$(vArea)'}, [FiscYTDAcctgFlag]={1}>} ActualAmount) //If we are not at the area level, we are reviewing a Region, so calculate the amount at the Area level

  );

In the formula above, vCompany and vArea are variables that capture the parent of the selected level of review. In my app, I have conditional display on the calculations so that a single Area or Region has to be selected, and therefore a single parent is available.

In the chart, I want to use $(vPLActualAmountYTD1) as my expression. Again, any help would be appreciated. Thanks.

0 Replies