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: 
Not applicable

How to set a dimension value in an expression.

I have a gauge that show the actual income as a percent of budgeted income. This should display the result for the user's selection of period and department. However I always want to show Income. So if the user has selected 'Fin Stmt Section' to be 'Expenses', I want the expression to overide this setting. ie set 'Fin Stmt Section' to be 'Income'.

The following doesn't really work: if("Fin Stmt Section" = 'Income', Sum(Actual$)/Sum (Budget$),0)



as it gives the correct result if the user selected 'income' otherwise is shows zero.

Thanks for your help..

Derek

1 Solution

Accepted Solutions
Not applicable
Author

Hi Derek,

If you got an field name with spaces in it, use the [ ] brackets

try using Set analysis:


Sum({$ <[Fin Stmt Section]={"Income"}>} Actual$) / Sum({$ <[Fin Stmt Section]={"Income"}>} Budget$)
This should do the trick


View solution in original post

2 Replies
Not applicable
Author

Hi Derek,

If you got an field name with spaces in it, use the [ ] brackets

try using Set analysis:


Sum({$ <[Fin Stmt Section]={"Income"}>} Actual$) / Sum({$ <[Fin Stmt Section]={"Income"}>} Budget$)
This should do the trick


Not applicable
Author

Thanks Rey-man - that worked and I've learned something new.