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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
stephenedberkg
Creator III
Creator III

YTD

I attach the sample app

YTD value are not coming correct?

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try this expression:

=Sum({<Year={$(=Max(Year))}, Months, Year, Month, MonthID = {"<=$(=Max(MonthID))"}>}

Aggr(If(Only({1}MonthIDS) = Max(TOTAL <ID> {<Month>} MonthID) + Only(TOTAL <ID> {<Month>} [lock period]),

Sum({<Year={$(=Max(Year))}, Months, Year, Month, MonthID = {"<=$(=Max(MonthID))"}>}sales)), ID, MonthIDS))


Capture.PNG

View solution in original post

11 Replies
PradeepReddy
Specialist II
Specialist II

create a variable as vMaxMonth=Max(MonthID)

Use that variable in set analysis..

stephenedberkg
Creator III
Creator III
Author

Dear pradeept

i tried this but its not working

sunny_talwar
MVP
MVP

What is the expected output you are hoping to see and in which object? Bar Chart or Text Box object?

stephenedberkg
Creator III
Creator III
Author

if i select Feb i want to see both jan and feb values in bar chart

sunny_talwar
MVP
MVP

Try this expression:

=Sum({<Year={$(=Max(Year))}, Months, Year, Month, MonthID = {"<=$(=Max(MonthID))"}>}

Aggr(If(Only({1}MonthIDS) = Max(TOTAL <ID> {<Month>} MonthID) + Only(TOTAL <ID> {<Month>} [lock period]),

Sum({<Year={$(=Max(Year))}, Months, Year, Month, MonthID = {"<=$(=Max(MonthID))"}>}sales)), ID, MonthIDS))


Capture.PNG

stephenedberkg
Creator III
Creator III
Author

Dear Sunny,

thank you

this is working correct in sample app

but while i applied in my app its not working correctly

please find attachment

sunny_talwar
MVP
MVP

Did it work?

stephenedberkg
Creator III
Creator III
Author

Dear sunindia


its working on that sample app only but its not working in my apps


i had post the app in previous command

sunny_talwar
MVP
MVP

Will be checking it.