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 add a calculated measure in Dimension for a Chart

Hi All,

I have requirement where we need to plot a Line chart for which I have to add a calculated measure in Dimension.

Below is the condition sum(if(year = 2013, field1/Field2 ,Field2/Field3).

Upon addition of the condition in the dimesion it plotting an error. Kindly let me know how to solve the issue.

Thanks

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Unfortunately you cannot, because when you perform a sum (or any other function), this is always related to the dimension.

Try some workaround

Anonymous
Not applicable
Author

It would be easier to help if there was an example of the application.  For now, a somewhat blind guess, based on the "Upon addition of the condition":

aggr(sum(if(year = 2013, field1/Field2 ,Field2/Field3), year)

christian77
Partner - Specialist
Partner - Specialist

try this

sum({$<Year={2013}   >} Field1/Field2) + sum({$<Year - = {2013}> Field2/Field3)