Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: In year to date function

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

4 Replies
MVP
MVP

Re: In year to date function

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;

Highlighted
Not applicable

Re: In year to date function

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

MVP
MVP

Re: In year to date function

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

Re: In year to date function

Thanks Massimo for the help.   Now I understood.