Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
curiousfellow
Specialist
Specialist

Analysis problem

This formula gives a correct value

Sum({$<period = {$(chosen_period)}>}value)

This function does not :

Sum({$<period <= {$(chosen_period)}>}value)     

(<= instead of < )

chosen_period is a value calculated by: max(period)

period is chosen from a listbox

Is it not possible to use the <= operator ?

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

Try

Sum({$<period = {"<= $(chosen_period)"}>}value) 

View solution in original post

7 Replies
nagaiank
Specialist III
Specialist III

Try

Sum({$<period = {"<= $(chosen_period)"}>}value) 

curiousfellow
Specialist
Specialist
Author

In my chart i now get for every period lower or equal than chosen_period the value of that period.

I would like to get the selected period and the sum of values until that period

Oleg_Troyansky
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm guessing from your response that period is one of your chart dimensions. If that's the case, set analysis cannot be used to select periods - the set analysis condition is only performed once per chart, not once per line.

Can you explain your need in more details? It sounds like you should use the "Full Accumulation" option, but I'm not totally sure...

cheers,

Oleg Troyansky

QlikView Your Business: An expert guide to Business Discovery with QlikView and Qlik Sense

sasiparupudi1
Master III
Master III

try

Sum({1<period = {"<= $(chosen_period)"}>}value) 

curiousfellow
Specialist
Specialist
Author

The solution of NagaianK and Oleg give the right results in a simple setup, but not in the app I am building. Must have another reason. Unfortunately I cannot publish this app here.

When I use Sasidhar's formula I get the total result whithout concerning the chosen period.

sasiparupudi1
Master III
Master III

may be you need to ignore other dimensions like date perhaps?

Sum({$<DATE=,period = {"<= $(chosen_period)"}>}value) 


hth

Sasi

curiousfellow
Specialist
Specialist
Author

Found that when I changed period into num(period) in my load script I get the correct results  using NagaianK's formula.

Thanks to all