Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
yugahare
Partner - Contributor
Partner - Contributor

Qliksense Line chart picking incorrect value after using aggr() function to plot %change

I am trying to plot daily energy consumption change for 10 users in a line chart. Using below formula


(
aggr(sum(energy_consumption), date, user) -
above(aggr(sum(energy_consumption), date, user))
)/above(aggr(sum(energy_consumption), date, user))

Above formula when we use in Table it returns the correct value for the % change. But while using same formula in Line chart it populates incorrect values.

Eg -

date_col, user, % Change
01-10-2019, user1, 8.9

But in the line chart the % Change value is plotted at 9.5 instead of 8.9 for user1 on 01-10-2019

Properties set for Line chart
Data
Dimensions - date_column
Line - user
Include null - unchecked

 

Labels (1)
1 Reply
Anil_Babu_Samineni

May be adding outer aggregation like

Sum((aggr(sum(energy_consumption), date, user) - above(aggr(sum(energy_consumption), date, user)))/above(aggr(sum(energy_consumption), date, user)))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful