Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

YTD calculation

Hi,

I have only year and month fields. and on selection of year and month, it should give me the addition of  consecutive months (january onwards, upto selected month/year)

For ex, on selecting 2014 March, i want sum of January2014 + february 2014 + march 2014 value.

How can it be done

Thanks.

23 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

If you reply via inbox you don't see that option.

try to open it in a new window.

Then click on reply, then you will see advance editor on bottom right.

Regards

ASHFAQ

Not applicable
Author

chk7.JPG.jpg

Not applicable
Author

Thanks

Please check the attached qvw

ashfaq_haseeb
Champion III
Champion III

Check this

Regards

ASHFAQ

tresesco
MVP
MVP

Try:

=Sum({<Year={$(=only(Year))},Month_Name, Month={"<=$(=Max(Month))"}>} [DS1Volume])

Like this, Month_Name field selection is disregarded to get your YTD.

PrashantSangle

Hi,

Please find attached example.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

but this way i get values for month Jan and Feb, and not the sum of Jan + Feb.

ytd1.JPG.jpg

How do i find the sum of jan+ feb in ytd1 column for Selection Feb 2014

ashfaq_haseeb
Champion III
Champion III

Try like this

Sum({<Year={"=$(=max(Year))"},Month_Name=,Month={"<=$(=Max(Month))"}>}[DS1Volume])

Regards

ASHFAQ

tresesco
MVP
MVP

Yes, if you have Month in the dimension, you have play a trick, like:

=RangeSum(Above(Sum({<Year={$(=only(Year))},Month_Name, Month={"<=$(=Max(Month))"}>} [DS1Volume]),0, RowNo(Total)))

Not applicable
Author

No, it doesnt provide me the sum.