Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
rrodrigueza
Contributor
Contributor

Problems Variables in Set Analysis

Hello everyone,

I'm trying to use Set Analysis on a Text Box with the following expression: 

=Num(sum({<Period={'$(=$(vMaxPeriodAnt))'}>}[Total Amount TC]),'#,##0')

My variables are this ones:

vMaxPeriod=Max(Period) and vMaxPeriodAnt=if(right($(vMaxPeriod),2)='01',Period-89,Period-1)

Have tried differents expressions but still 0 as result, when i use Date in set analysis i got the answer but i need to work with Period.

Hope you can help me.

Regards!

Labels (1)
3 Replies
Vegar
MVP
MVP

Is period a dual value? If so then you need to make sure that the output of your modifier is in the same format as your Period field. In set analysis you are doing string comparisons (not numeric) when using dual values.

rrodrigueza
Contributor
Contributor
Author

Hi Vegar,

All my Period values are made by this formula year(Date) & if(num(month(Date))<10,'0'&num(month(Date)),num(month(Date))) so is a String Value. However, QlikView is recognizing it as a Number value but is the same value as string or number. Also, you say in set analysis we compare string so is not possible to not compare numbers?? 

Thank so much for you replay!

Regards

Vegar
MVP
MVP

Try edit your variables like this:

Vegar_0-1587067381623.png

Expression  like this:

sum({<Period={"$(=$(vMaxPeriodAnt))"}>}[Amount])

It is a slightly different approach but the result will be as you attemptet. See attached qvf