Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Transforming MTD data to YTD with List box selections

Hello,

I have data loaded in MTD form, and the user is looking for the graphs created to be able to show year to date on selections.  Currently in my graphs it will sum for the year to date in November based on all of the information loaded.  When the user selects Jun, the graph changes only to June data.  The only way currently for the user to select June YTD is to select Jan-Jun in the list box.  Is there a way to achieve the desired result without selecting every single month prior?  Not sure if it is set analysis, or whatever syntax that would be needed.

Currently there is not a Master Calendar, as the only required time period is year and month.  There is also a year call PLAN.

Any help and direction would be great!

Justin

3 Replies
Not applicable
Author

Please create a new field in the back-end like

If(DayNumberOfYear(DateField) <= DayNumberOfYear(Today()),1,0) AS YTD

Now use this flag in your expressions on the front end. Like

Sum({<YTD={1}>}Sales)

Thanks

Anonymous
Not applicable
Author

Ajay,

When adding the new YTD field, I do not seem to get anything but 0's.  I have included how my date field is set up, and the output of the YTD field.  Any thoughts on how to change the code given my fields?

LISTBOX.png

Thank you,

Justin

Not applicable
Author

Dont you have a Date field like '9/23/2014'. The If() statement will work only for those.

Maybe can you attach a sample file?