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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Previous Fiscal Year Expression Issue

I am using the YTD expressions found in these posts, with slight modification for the fiscal year starting July-1: YTQ, QTD, MTD and WTDPrevious YTQ, QTD, MTD and WTD

My Fiscal YTD set analysis expression is the following, this works perfectly

{$<Year=, Month=, Date=, DateNum={">=$(=Num(YearStart(Max(DateNum),0,7)))<=$(=Max(DateNum))"}>}

My Previous Fiscal YTD expression doesn't work at all - I'm assuming its a syntax error as the set analysis doesn't restrict data at all when its used.

{$<Year=, Month=, Date=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1,7)))<=$(=AddYears(Max(DateNum),-1))"}>}

Could anyone take a look at these expressions and tell me what is wrong with the second one?

Thanks for the help!

1 Solution

Accepted Solutions
sinanozdemir
Specialist III
Specialist III

Hi,

It seems like your DateNum field is not formatted as date. If so, try the below:

{$<Year=, Month=, Date=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1,7)))<=$(=Num(AddYears(Max(DateNum),-1)))"}>}


Hope this helps.


Thanks

View solution in original post

2 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

It seems like your DateNum field is not formatted as date. If so, try the below:

{$<Year=, Month=, Date=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1,7)))<=$(=Num(AddYears(Max(DateNum),-1)))"}>}


Hope this helps.


Thanks

sunny_talwar
MVP
MVP

May be this

{$<Year=, Month=, Date=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1,7)))<=$(=Num(AddYears(Max(DateNum),-1)))"}>}