Skip to main content
Announcements
See why Qlik was named a Leader in the 2024 Gartner® Magic Quadrant™ for Data Integration Tools for the ninth year in a row: Get the report
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Comparative analysis trouble

Hello,

I currently have an issue where I am using set analysis for month-to-month comparative analysis; however, I can't seem to get it to work properly.

Here is my equation below.

=if(

(

     sum({$<Period_Num = {"$(=max(Period_Num))"}, YearField = ,month_name =, DATE = >} Value1)/sum({$<Value2 = {'*'},      Period_Num= {"$(=max(Period_Num))"}, YearField = ,month_name =, DATE = >}Value3)

)

>

(

     sum({$<Period_Num= {"$(=max(Period_Num)-1)"}, YearField = ,month_name =, DATE = >} Value1)/sum({$<Value2 = {'*'},      Period_Num= {"$(=max(Period_Num)-1)"}, YearField  = ,month_name =, DATE = >}Value3)

)

  ,1,0)

This is equation returns 0 for each row and each month.  Am I missing something simple?

1 Reply
swuehl
MVP
MVP

It's hard to tell what's wrong with the information given. Context matters, so more information about the expression context, the data model and data would be helpful. If possible, upload a small sample QVW.

To start debugging your expression, try to put each aggregation function (Sum() ) in an expression on its own and check the returned values (also when changing the selection).

I assume you are not expecting the set analysis to somehow consider your current dimension lines, right? Set analysis is evaluated only once per chart, not per dimension line.