Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Partner
Partner

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

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
New Contributor

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 ?