Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

How to make expression independent of selection when used Valuelist

Hello Everyone,

I am facing a problem in making a expression independent of selection for one field , as I am using 2 dimension one is valuelist and other one is Financial month , and in the expression I want to see the data for the complete year but when I am using selection in Financial month it is selecting that month data and not showing all the months so not sure that it is due to valuelist function or I am doin some mistake.

Thank you

Ferha

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Ok, that's a bit weird. But try this: If(only({<Month=>}ValueList('A','B'))='A',Sum({<Month=>}Amount),If(only({<Month=>}ValueList('A','B'))='B',Sum({<Month=>}Value)))


talk is cheap, supply exceeds demand

View solution in original post

9 Replies
Gysbert_Wassenaar

You need to add something to your expressions to make them ignore selections in the financial month field. For example if you have sum(Amount) then change it to sum({<[Financial Month]=>}Amount) to ignore selections in the field [Financial Month].


talk is cheap, supply exceeds demand
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Yes I did that , I have a expression like if(valuelist('Gross','Income')='Gross', sum({<[Financial Month]=>}Amount)) as I have Financial Month as second dimension , but is not giving value for all the month , it is giving value for the selected month not sure because of valuelist function or is there any other way.

Gysbert_Wassenaar

Please post an example qlikview document that illustrates the problem.


talk is cheap, supply exceeds demand
ferha_jafri
Partner - Creator III
Partner - Creator III
Author

In the sample application I want to see all months data even if month is selected, i.e independent of month selection.

Gysbert_Wassenaar

Ok, that's a bit weird. But try this: If(only({<Month=>}ValueList('A','B'))='A',Sum({<Month=>}Amount),If(only({<Month=>}ValueList('A','B'))='B',Sum({<Month=>}Value)))


talk is cheap, supply exceeds demand
tresesco
MVP
MVP

Yes, a bit weird! but a simpler expression without nested IF works. Try:


If(ValueList('A','B')='A',Sum({<Month>}Amount),Sum({<Month>}Value))

MayilVahanan

HI

PFA

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
tresesco
MVP
MVP

Or, for multiple comparisons, you may go for pick(match()..combination like:

Pick(Match(only({<Month>}ValueList('A','B')), 'A','B'), Sum({<Month>}Amount),Sum({<Month>}Value))

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

Thank you Gysbert it is working and yes it is a bit weird as well thanks again...