Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlik_Developer1
Contributor II
Contributor II

Average calculation in load script

Hi All,

 

i have data like below 

date               month     year    sales

20- jan-22     jan           22         50

21-Jan-22     Jan          22         100

20- feb-22    feb         22         150

21-feb-22    feb          22         10

22-feb-22    feb          22         20

 

i want Avg by Month level by using date

 

output should be like below

  month     year    sales

    jan           22         (50+100) 2 = 75 is output for jan

  feb             22        (150+10+20) 3=90 is output for feb

 

how to get above results in load script 

 

thanks

 

 

 

1 Reply
rubenmarin

Hi, if you have a table with month and year as dimension you only ned an expression like Avg(sales).

If your table also contains the date you can ignore it using 'TOTAL', and between <> the dimensions you don't want to ignore:

Avg(TOTAL <month> sales)