Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Wise Last 3 month Sales

Hi All,

I am in a situation where I am not finding any clue to solve this problem. The report which I have to make is a line chart where in x axis is all the Date Values Available in the Date field and Y axis I want to know the sum of sales for last 3 months excluding the current month.

For ex-

for all dates of October i need sum of sales for July , august,September , for all dates of September I should get sum of sales of June , July , august and so on in a line chart.

Example.png

I have tried doing that but I am getting a parallel line which the nothing but sum of sales of July, August, September which is fine for all date like 1st Oct to 8th Oct but for September the value should change though it should be same through out all dates of September, similarly it should change for other months and should be same through out the month.

The expression which I have used for this is

=Sum({<Month= ,Day=,[Product Type]=,Item_NOC=,

ProductDescription=, Age=,

Common_Date={">=$(=Date(Date#(monthstart(AddMonths(Max(Common_Date),-3)),'mm/dd/yyyy'),'dd/mm/yyyy'))<=$(=Date(Date#(monthend(AddMonths(Max(Common_Date),-1)),'mm/dd/yyyy'),'dd/mm/yyyy'))"}>}

InvoiceQty).

Please help me with a correct solution.

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

it's not possible here to use Date both as a dimension and in the set modifier in the expression.

You may need a variation of asoftables check below links. Hope it helps

The As-Of Table

Calculating rolling n-period totals, averages o... | Qlik Community