Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD from previous year

Hello togehter,

I have a YTD Formula (it Shows the right figures)

Sum({$<Nature={'Actual'},[Fiscal Year]=, month=, DateNum={">=$(Num(YearStart(Max(DateNum))))<=$(=(Max(DateNum)))"}>} Amount)

this formula Shows the wrong figures

Sum({$<Nature={'Actual},[Fiscal Year]=, month=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1)))>=$(=AddYear(max(DateNum), -1 ))"}>}Amount)

Do you know why? and could help me.

Thanks

1 Solution

Accepted Solutions
crusader_
Partner - Specialist
Partner - Specialist

Oh, Are you sure about AddYear function???

Try this

Sum({$<Nature={'Actual},[Fiscal Year]=, month=,

               DateNum={">=$(=Num(YearStart(Max(DateNum),-1)))<=$(=Num(AddMonths(max(DateNum), -12 )))"}>}

          Amount)

View solution in original post

10 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

Have a look at below post.

http://community.qlik.com/docs/DOC-7045

Regards

ASHFAQ

crusader_
Partner - Specialist
Partner - Specialist

Hi,

Smth wrong in your >= <= logic I suppose.

Sum({$<Nature={'Actual},[Fiscal Year]=, month=, DateNum={">=$(=Num(YearStart(Max(DateNum),-1)))>=$(=AddYear(max(DateNum), -1 ))"}>}Amount)


Please check it.

Hope this helps.

Andrei

MK_QSL
MVP
MVP

Sum({$<

Nature={'Actual},

[Fiscal Year]=,

month=,

DateNum= {“$(=Num(YearStart(Max(DateNum)),-1))<=$(=AddYear(Max(DateNum),-1))”}Amount)

Not applicable
Author

This is the formula of this post with the Appendix Nature={'Actual'}

Not applicable
Author

I Shows only 0 and no values.

Can give me hint why?

Not applicable
Author

this code Show nothings no figure only a space.

Do you have a other question?

MK_QSL
MVP
MVP

Yes, Provide sample data 🙂

crusader_
Partner - Specialist
Partner - Specialist

Oh, Are you sure about AddYear function???

Try this

Sum({$<Nature={'Actual},[Fiscal Year]=, month=,

               DateNum={">=$(=Num(YearStart(Max(DateNum),-1)))<=$(=Num(AddMonths(max(DateNum), -12 )))"}>}

          Amount)

Not applicable
Author

What do you mean with sample data? The structure of the table?