Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Join us on Feb.12 to Discover what’s possible with embedded analytics: REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
Ankit3
Contributor II
Contributor II

Error in Dual If logic

Hi All,

Need to change the KPI values in the dashboard where I am using the below logic for multiple time periods, which gives me a calculation error. Can you please help me here where actually I am going wrong.


sum(IF(TIME_BUCKET='YTD' and [SALE_DATAMART-1.R17W]='Y',VALUES))-(sum(if(TIME_BUCKET='YTD' and PREV_R17W='Y',VALUES)))

/sum(if(TIME_BUCKET='YTD' AND PREV_R17W='Y',VALUES,


sum(IF(TIME_BUCKET='TTD' and [SALE_DATAMART-1.R17W]='Y',VALUES))-(sum(if(TIME_BUCKET='TTD' and PREV_R17W='Y',VALUES)))

/sum(if(TIME_BUCKET='TTD' AND PREV_R17W='Y',VALUES))

Labels (1)
1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You seem to be missing at least two closing parens on the second line. Even then it would not be correct because you have two separate expressions.  Is it that you want one calculation for YTD and another for TTD?

Is TIME_BUCKET a dimension in your chart?

-Rob