Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
March 11, 2PM EST: Do More with Qlik - Getting Started wtih Qlik Sense SaaS - Redux. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
c_pannese
Partner
Partner

Dynamic Set Analysis

Hi All,

i've an issue with Set Analysis.

I have to calculate a Cumulative measure but i cannot use above function because it doesn't work correctly for me when i make selections.

The reference measure is

Sum( {$< MonthDiff={'-1'} >} #MEASURE)

i'm trying to use this formula for having cumulate:

Sum( {$< MonthDiff={'-1'} >} #MEASURE)  +

Sum({$<MonthDiff={">=0 <=$(=num(Month(AsOfMonth))-2)"}  #MEASURE)


The problem is that the string    <=$(=num(Month(AsOfMonth))-2)    doesn't work.

How can i write this for Set Analysis?


Thank you All.

11 Replies
sasiparupudi1
Master III
Master III

What is the value in AsOfMonth?


If you put the expression num(Month(AsOfMonth))-2

in a text box, do you get the numeric value?

sunny_talwar

You might be able to make Above() work even with selections.... do you have an example where Above() is not working with selections?

c_pannese
Partner
Partner

a.png

if i make selection:

b.png

c_pannese
Partner
Partner

For me The AsOfTable is a Time field 'YYYY MMM'

sunny_talwar

What was the expression you used for accumulation?

c_pannese
Partner
Partner

Rangesum( Above(Sum({$<MonthDiff={'-1'}>}  #MEASURE ) ,0, RowNo(total)))

sunny_talwar

Try this

Rangesum(Above(Sum({$<MonthDiff={'-1'}, AsOfMonth>}  #MEASURE ) ,0, RowNo(total))) * Avg({$<MonthDiff={'-1'}>} 1)

c_pannese
Partner
Partner

Conceptually it is right and works.

But isn't what i'm looking for.

sunny_talwar

oh okay... but if it gives the right number, then why are you not looking for this