Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i want to compare same day of two year in qlikview
that means if i want sales till 04 jan in 2012
then i want to compare it with 04 jan 2011.
hope someone can helps me
You want only the sales for that dates or YTD? I assume latter:
=sum( {<Date = {">=$(=yearstart(Date))<=$(=today())"} >} Sales)
=sum( {<Date = {">=$(=yearstart(Date,-1))<=$(=addmonths(today(),-12))"} >} Sales)
The Date format must match the format returned by yearstart and addmonths, or use num() functions around latter two.
Hope this helps,
Stefan
i want ytd for current year and last year
but both till date 01/05/2011
i want comparision of
05 Jan 2012 and 05 Jan 2012
hope you understand
Hi Sunil,
Do you want comparision of 05 jan 2011 and 05 jan 2012 ?
If you want the comparision of selected date value with last year same date value then you can use:
=sum( {<Date = {"$(=Max(Date))"} >} Amount)
=sum( {<Date = {"$(=addmonths(Max(Date),-12))"} >} Amount)
Hope this will help
thanks steafen and vijay .
@Steafen:
hello steafen you post is working for me but i when i click on 03 jan 2012 then it is not working.
so it should also works on other dates not only today
Try
=sum( {<Date = {">=$(=yearstart(Date))<=$(=Date(max(Date)))"} >} Sales)
=sum( {<Date = {">=$(=yearstart(Date,-1))<=$(=addmonths(max(Date),-12))"} >} Sales)
Regards,
Stefan
How I do this if I wanted to compare the below dates, both Thursdays from each year.
Do you want comparision of 06 jan 2011 and 05 jan 2012 ?
Alex, the same weekday, a year back, could probably be calculated like going 52 weeks or 364 days back in time, right?
like
=only({<Date= {'$(=Date(Date-364))'}>} Sales)