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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculation issue

I have below expression as calculation.

Sum({<Flag={'1'}>}Value) but when other value is selected from flag it should display the result for that.

7 Replies
andrespa
Specialist
Specialist

Hi, maybe you have a conceptual problem? That expression always give you back the result of having Flag=1 no matter what other value of Flag you select.

Best regards,

Andrés

Anonymous
Not applicable
Author

Hi Chang,

You will always get the sum of selections of Value when Flag = 1, but if you want for every selections ever, you may use this Sum({1<Flag={'1'}>}Value)

Thanks!

sunny_talwar

May be this:

If(GetSelectedCount(Flag) = 0, Sum({<Flag={'1'}>}Value), Sum(Value))

Not applicable
Author

Let me clear it again.. current expression gives the value for Flag=1 but there could be other values too in Flag filed like 2,3,4. So when I select Flag=2 it should display value for Flag=2

Hope it is clear now

Kushal_Chawda

Not sure but may be this

Sum({<Flag *={'1'}>}Value)

Anonymous
Not applicable
Author

Hi Chang Din,

There is two ways:

     Sum({<Flag={$(=Max(Flag))}>}Value) or Sum(Value)

Regards

sasiparupudi1
Master III
Master III

remove Flag from the set analysis and the sum should display values according to the value selected in the flag

Sum(Value).

Other option could be is to set a variable in input box

vFlag with values as 1,2,3,4,5

in the expression Sum({<Flag ={'$(vFlag)'}>}Value)


hth

Sasi