Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Meg00
Contributor III
Contributor III

Help with variable within set analysis

Hello,

Example of current set analysis:

=num(sum({$<Lev = {1},PeriodCounter ={">=$(#=max(PeriodCounter)-11<=$(#=max(PeriodCounter))"},period=>}Netsales)*-1/1000000,'# ##0')

I want to store the red part (rolling 12) in a variable. But how do I then use that variable correct? I can't get the right syntax.

Thanks,

Meg

 

1 Solution

Accepted Solutions
jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

You should create the variable vSetExpression with the following content

PeriodCounter ={">=$(#=max(PeriodCounter)-11<=$(#=max(PeriodCounter))"},period=

And then you invoque it as follows

=num(sum({$<Lev = {1},$(vSetExpression )>}Netsales)*-1/1000000,'# ##0')

Let me know your doubts! Regards,

Jaime.

View solution in original post

2 Replies
jaibau1993
Partner - Creator III
Partner - Creator III

Hi!

You should create the variable vSetExpression with the following content

PeriodCounter ={">=$(#=max(PeriodCounter)-11<=$(#=max(PeriodCounter))"},period=

And then you invoque it as follows

=num(sum({$<Lev = {1},$(vSetExpression )>}Netsales)*-1/1000000,'# ##0')

Let me know your doubts! Regards,

Jaime.

Meg00
Contributor III
Contributor III
Author

Thank you, was more simple than I thought:)