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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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
MVP
MVP

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)