Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

monthtodate compared with previous year the same period

hi all,

how can i do a formula for this situation(or another solution for this)?

the source is something like this:


Date                Value        Salesman

9/1/2012           2              George

9/2/2012           12            Luisa

....

9/30/2012         4              Luisa

...

9/1/2013           6             Alex

9/2/2013           19            Mary

and i want to make a straight table like this in which i want to compare month to date with the same period in previous year

Salesman      Value 2013                                                             Value 2012

George               sum({<Year=2013>}Value) ...1-2 sep                                 sum({<Year=2012>}Value)   1-2 sep

Luisa

Alex

Mary

thanks a lot

5 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: monthtodate compared with previous year the same period

You need to create a Year field in the script using the Date field:

Load

   Date,

   Year(Date) as Year,

   Value,

   Salesman

From ...mysource...;

Once you have that year field you can use the set analysis expressions you posted above. It sounds like you want to select a month. In that case you also need a Month field: Month(Date) as Month

If you need more help please post an example document with sample data.


talk is cheap, supply exceeds demand
Highlighted
Not applicable

Re: monthtodate compared with previous year the same period

Hi,

PFA

Highlighted
Not applicable

Re: monthtodate compared with previous year the same period


suppose that i have data until yesterday and every day the source will be updated with last day

so i want to compare 1-17 sep 2013 vs 1-17 sep 2012; tomorrow i want to apear a calculation like 1-18 sep 2013 vs 2012 and so on

thanks all of you

Highlighted
Not applicable

Re: monthtodate compared with previous year the same period


so the problem is how do i create a formula to calculate for the same period last year depending by this year

Highlighted
Not applicable

Re: monthtodate compared with previous year the same period

hi,

thanks for your help; i commented on the bottom my problem; i want to calculate automatically last year the same period

1-17 sep 2013 vs 1-17 sep 2012 not all sep 2012

thanks