Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

In year to date function

I have a doubt about inyear to date function

inyeartodate(Tempdate, $(vToday),0)* -1 as CurYTDFlag,

inyeartodate(Tempdate, $(vToday, -1)* -1 as LastYTDFlag,


in the first part of the script it says -1 as CurYTDFlag and in the second part it says that -1 as LastYTDFlag. So CurYTDFlag will be -1 or LastYTDFlag, will be -1? can someone clarify on this.

1 Solution

Accepted Solutions
maxgro
MVP
MVP

it was in your script

I think:

- without *-1 you get 0 e -1 as result

- with *-1 you get 0 e 1 as result

http://community.qlik.com/message/601177#601177

View solution in original post

4 Replies
maxgro
MVP
MVP

it depends on Tempdate (I think vToday is Today)

try this to see the difference (add the result to a table box)

a:

load

  date(makedate(2014) + rowno()-1) as Tempdate

autogenerate 730;

load

  Tempdate,

  InYearToDate (Tempdate, today() , 0)*-1 as InYearToDate_Today_0,

  InYearToDate (Tempdate, today() , -1)*-1 as InYearToDate_Today_1

Resident a;

Not applicable
Author

Thanks Massimo.

I tried using this script. One thing which is not clear is why have you used -1 as InYearToDate_Today_0and InYearToDate_Today_1. I am very new to qlikview

maxgro
MVP
MVP

it was in your script

I think:

- without *-1 you get 0 e -1 as result

- with *-1 you get 0 e 1 as result

http://community.qlik.com/message/601177#601177

Not applicable
Author

Thanks Massimo for the help.   Now I understood.