Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
tripatirao
Creator II
Creator II

YearToDate()

Hi all

Can any one explain about YearToDate()...?

Thanks

5 Replies
gautik92
Specialist III
Specialist III

YearToDate(date [ , yearoffset [ , firstmonth [ , todaydate] ] ])

Returns true if a date falls within the year to date, else false. If none of the optional parameters are used, the year to date means any date within one calender year from January 1 up to and including the date of the last script execution.

tripatirao
Creator II
Creator II
Author

Hi avinash

Can you tell me how this expression works.

I am trying to find  YeartoDate Dynamically

-Sum(Sales * YearToDate(Date, 0, 4, vYEDate))

the value of  vYEDate=41364(31st march 2013)

jonathandienst
Partner - Champion III
Partner - Champion III

I have never used it like this, but that should work - it will give all sales in FY 2012/3. Is that what you want? What are you getting?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
stephenedberkg
Creator II
Creator II

i hope this attachment is more useful for you 

jrdunson
Creator
Creator

Tripati

Could you use a flag field in the load script?... something like:

Load

  SaleDate,

  SaleAmt,

  if( DayNumberOfYear(SaleDate) < DayNumberOfYear(date(now())), 1, 0) as as [SalesYTD]

Then in in your expression

  Sum({$<[SalesYTD]={1}>} SaleAmt)

This would be 'dynamic' - per each reload...

Just two cents

Jarrell