Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

gkourogiorgas
New Contributor II

Last 2 years of purchases

Hi

I am trying to get the sales of the last 23.5 months (705 days)

This is what I have come up with so far:

sum({<Accumulator_Type={'BILLED','RETAIL'},[Transaction_Date.autoCalendar.Date]={'>=$(=Date(today()-705,&Chr(39)&DD-MM-YYYY&Chr(39)&))'}>}Value-Tax)

The problem is that when I change the number 705 I get the same amount of sales although I shouldn't.

Can anyone help?

Kind Regards

George

1 Solution

Accepted Solutions

Re: Last 2 years of purchases

Try this

Sum({<Accumulator_Type = {'BILLED','RETAIL'}, [Transaction_Date.autoCalendar.Date] = {">=$(=Date(Today() - 705, 'DD-MM-YYYY'))"}>} Value-Tax)

4 Replies

Re: Last 2 years of purchases

Try this

Sum({<Accumulator_Type = {'BILLED','RETAIL'}, [Transaction_Date.autoCalendar.Date] = {">=$(=Date(Today() - 705, 'DD-MM-YYYY'))"}>} Value-Tax)

gkourogiorgas
New Contributor II

Re: Last 2 years of purchases

Thanks. I tried it but get 0s everywhere

Re: Last 2 years of purchases

Can you share the script for your Derived Calendar?

gkourogiorgas
New Contributor II

Re: Last 2 years of purchases

You are right. It worked. I just had to change the format of the date from DD-MM-YYYY to DD/MM/YYYY