Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
mattyori
Contributor
Contributor

Use filter result in expression

I'm working on getting KPI's for users with minimum Qlik experience (Like myself, I'm very new to it) and want to use minimum filter options. My issue is when when filtering down by month you also need a second "Fcst" month. I want to use the month selected in the filter to apply for the "Fcst" Month.

e.g. if "Mar" (March) is selected I would like the expression to use "Mar Fcst"

here is what I have

Sum({<[Account Number]={"123456"},Subledger={"1234"},[Fcst Month]=(Month+ 'Fcst')>} Amount)

Labels (3)
1 Solution

Accepted Solutions
mattyori
Contributor
Contributor
Author

The solution that worked was creating a variable and using it in the expression.

Variable: =GetFieldSelections(Month) & ' Fcst'

Expression: Sum({<[Account Number]={"123456"},Subledger={"1234"},[Fcst Month]={"$(VFcstMnth)"}>} Amount)

View solution in original post

2 Replies
rubenmarin

Hi, you can use $(=...) to insert a calculated text, it could be something like: [Fcst Month]={'$(=Month) Fcst'}

But months could be tricky, they are usually a dual value, maning that they could be a text and a number at the same time, so maybe it's traslated as [Fcst Month]={'3 Fcst'} and it won't work as expected.

So maybe you need: [Fcst Month]={'$(=Text(Month)) Fcst'}

Or if there are many months selected (or none) maybe you want the max month, in that case maybe this could work: [Fcst Month]={"$(=Date(MakeDate(0,Max(Month)),'MMM')) Fcst"}

mattyori
Contributor
Contributor
Author

The solution that worked was creating a variable and using it in the expression.

Variable: =GetFieldSelections(Month) & ' Fcst'

Expression: Sum({<[Account Number]={"123456"},Subledger={"1234"},[Fcst Month]={"$(VFcstMnth)"}>} Amount)