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

Formula in a field

Hi, I am trying to do something I thought would be easy:

I have Accounts and Values. For some accounts, I want to show sum(Values). For others, I have some other calculation. I thought I could add those in an Excel file and load them such as:

Account IDCalculation
A100sum(Values)
A200avg(Values)
A300total(Values)

Now, in my tablebox, I have Account ID as a dimension and Calculation as an Expression. This shows me the text entered in Calculation. Is there a way to have it interpreted the formula?

Thanks and regards

1 Reply
Not applicable
Author

It's not possible to do. It is breaking some chart concepts. Think about how QV should calculate a total result for the Calculation column if you check Expression Total. You should have just one explicit formula. In your case I would use IF, like this:


if([Account ID] = 'A100', sum(Values),
if([Account ID] = 'A200', avg(Values), sum(total Values)))