Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Rolling 3, 6, 12 months based on filter selection - Qlik Sense

Hi Guys,

I have weekly sales data which only has following fields.

Fields
RepName
ProductName
Sales (Total number of sales)
WeekDate (every 7th Date)

I am planning to do an inline load containing 1 column and 6 rows as per below so that I can use it as filter.

SumType
RM
RQ
RY

One of my expression is like below

Sum(Sales)/Sum(TOTAL <RepName> {<ProductName>} Sales)

What would be the best way to write above expression based on what sumType is selected rolling 3, 6 or 12 months.

Thanks

4 Replies
sunny_talwar

Would you be able to share some sample data to test out and play around with it? Also share the expected output in numeric terms.

Best,

Sunny

Not applicable
Author

Hi Sunny, Attached a sample data for Aug 2016 to Dec 2016

sunny_talwar

What is the output needed from this sample?

Not applicable
Author

What I want is an expression when If I select the SumType Filter as RQ then it should only show sales contribution for last 3 months of the max date available in the data set.

So as an example,. current expression is like below

Sum(Sales)/Sum(TOTAL <RepName> {<ProductName>} Sales)


Now, if I select the filter SUMType as RQ then the above expression should only show result for month of Oct, Nov, Dec instead of Nov, Dec, Jan because max date in the sample data is only till Dec.

Does is make any sense? or have I made it too complicated?

Thanks