Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

button for month to date for current year and for previous year

Hi all,

i want to create 2 buttons:

consider we have data until 20 oct 2013 and all 2012 (by days - with format: 10/20/2013)

1. one button is for month to date (but i want to select also 1-20 oct 2012) for a comparison in a graph

2. a button for year to date - here is practically the same problem..oct 2012 is taken 1-31 so i want to eliminate 21-31 oct 2012

thanks

Cosmin

5 Replies
Anonymous
Not applicable
Author

Cosmin

Looks like what you are describing is often referred to as Prior Period Comparison.

If you Google QlikView Prior Period Comparison you'll come up with plenty of good hits against it.

I have not added any url's as they seemed to get trapped by the auto moderation and get held up for hours if not days.

Best Regards,     Bill Markham

Not applicable
Author

thanks for your answer Bill

i will explore on google

thanks again

Not applicable
Author

i solved the button for month to date

select a field - Month // search string: =Month (max(Date))

select a field - Day // search string: ='<='&Day(max(Date))

i had created first in syntax 2 new fieds.. Month(Date) as Month and Day(Date) as Day

i'm still struggling with the button for year to date (i don't know how to make to compare the same number of days for previous year - 1 jan - 20 oct 2013 vs 1 jan -20 oct 2012 and not 1 jan - 31 oct 2012)

thanks

ps: i hope it will help other people the solve from the top

fheidenstecker
Creator II
Creator II

Hi,

Do you work with a master Calendar?

I solved this by generating a Flag Field in the Calendar

if((Date(TempDate) >= Yearstart(Today()) AND Date(TempDate) <= Today()) OR (Date(TempDate) >= YearStart(AddMonths(Today(),-12)) AND Date(TempDate) <= addmonths(Today(),-12)),1,0) as YTDFlag

Hope that helps!

Cheers,

Fabian

Not applicable
Author

hi,

i don't use one yet

the best what i found is that in a button i put:

selection for years (2013 and 2012)

month (jan-oct)

and weeks until the week which contains last day - but it is not the same with year to date: when last day is tuesday..the biggest week from previous year will be completed comparing with now

thanks Fabian