Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
priyapanchi
Partner - Contributor
Partner - Contributor

Month On Month avg of Sales

Dear All,

I want to to create a pivot which shows me month on month the avg of sale

The avg of sales should be as follows:

On timeline.

when in Apr->Should show avg of Feb,Mar,April

When in May->Should show avg of Mar,Apr,May

When in Jun->Should Show avg of Apr,May,Jun

From July to Mar it should show the avg from Apr to the Particular month

i.e ->

When in Jul ->Should Show avg of Apr to Jul

Kindly find the attached screen shot of the data model.

Data- This table has the transaction wise data.

Master_Cal-This is the Master Calendar

Master_Cal-1- In the table ,i have created Month_AsOf field and MonthYearID

Suppose if the ID for Apr is 13--Master_Cal-1 is having data as follows

Month_AsOf,MonthYearID

13,11

13,12

13,13

14,12

14,13

14,14

15,13

15,14

15,15

16,13

16,14

16,15

16,16

I need to create a pivot having timeline on basis of MonthYear.

Kindly help me with the issue.

2 Replies
Anil_Babu_Samineni

Looks like you want only three months backword average. If so, go with set analysis lines

Sum({<month={">=$(=max(month)-3)<=$(=max(month))">} sales)

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
priyapanchi
Partner - Contributor
Partner - Contributor
Author

Dear Anil,

Thanks for the reply.

But i want the Month field in dimension in the pivot.

Thanks,

Priya