Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
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.