Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

itatspectrum
Not applicable

inyeartodate with Date not Month Flag as start of Year.

Hi All,

I have a company that for commercial reasons has their Sales year starting on 26/12 every year.

I tend to use the following to create my YTD/LYTD flags but I need to replace the Start Month parameter with a specific date?

if(year2date(Inv_Date,0,12),1,Null()) as  Inv_YTD,                                                 
if(year2date(Inv_Date,-1,12),1,Null()) as  Inv_LYTD,


Any ideas anyone?


Cheers


Steve

Tags (1)
2 Replies
sunny_talwar
Not applicable

Re: inyeartodate with Date not Month Flag as start of Year.

How about this

If(YearToDate(Inv_Date-26, 0, 12), 1, Null()) as  Inv_YTD,                                                 

If(YearToDate(Inv_Date-26, -1, 12), 1, Null()) as  Inv_LYTD,

nawfal_bouharat
Not applicable

Re: inyeartodate with Date not Month Flag as start of Year.

Hi ,

Im trying to count specific cells in Qlicksense and to compare them based on the same day one year ago.

=Count({$<[ORDER_DATE.autoCalendar.Year]+={2017}>}COMMISSION)

This is until where I could go. My cell (ORDER_DATE) is transferred with the autocalender to YEAR. so I can count on values containing 2017 and 2016 to compare the whole year. Good for December but not so good for januari. I see that there is a Function Year2Date but I cannot find the way to insert it.

Could anyone help ?