Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Average of expression

Hi ,

How to calculate the average for the below expression.

Logic : num(Sum({$<A7AIDT = {"$(=vYesterday)"}>} ESIGN_COMPLETE_NEW)/Sum({$<A7AIDT = {"$(=vYesterday)"}>} TOTAL_ORDERS_DAILY_NEW),'##.00')*100)

Thanks...

10 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

I assume you mean you want to calculate the average of this expression over a given dimension? In that case try this:

Avg(

Aggr(

Sum({$<A7AIDT = {"$(=vYesterday)"}>} ESIGN_COMPLETE_NEW)/Sum({$<A7AIDT = {"$(=vYesterday)"}>} TOTAL_ORDERS_DAILY_NEW)

,<YourDimension>)

)

Hope this helps,

Jason

Anil_Babu_Samineni

Try with single quote. And usually average is

Sum(Sales)/Count(TOTAL Sales)

num(Sum({$<A7AIDT = {'$(=vYesterday)'}>} ESIGN_COMPLETE_NEW)/Sum({$<A7AIDT = {'$(=vYesterday)'}>} TOTAL_ORDERS_DAILY_NEW),'##.00')*100)

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
nareshthavidishetty
Creator III
Creator III
Author

Hi,

It's showing the same percentage results.

Thanks..

sunny_talwar

Would you be able to share more details as to what you are looking to get?

nareshthavidishetty
Creator III
Creator III
Author

Hi,

We have calculating the sales percentage based on the below,

Logic : num(Sum({$<A7AIDT = {"$(=vYesterday)"}>} ESIGN_COMPLETE_NEW)/Sum({$<A7AIDT = {"$(=vYesterday)"}>} TOTAL_ORDERS_DAILY_NEW),'##.00')*100)

We are getting the results as below,

Untitled.png

But my user needs the average of these percentages(top of the bar),in an line chart as well..


Thanks..

sunny_talwar

Have you tried adding a Avg trendline?

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Did you try my Aggr() solution?

nareshthavidishetty
Creator III
Creator III
Author

yes, i have tried but it's showing an straight line.

I need to show an trend line.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

Ah, then as Sunny T says, just add a trendline in the chart Expression tab.