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

Announcements
Note: You may notice some temporary visual or styling issues in the Community. Our vendor is actively investigating.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Ytd from selection

Hi,

I'm currently trying create a YTD Sales values for a selected date
I've done YTD with a calendar script in a previous app with: inyeartodate(Date, '$(vtoday)', 0) * -1 AS YTD

Our customer wants to have the ability to select day, month and year and based on the selected date they want to see YTD values in a chart.

I'm writing the selection to the variable v_dateselection.

I'm not sure what's the best way to do this. Can someone help me? Thanks.

10 Replies
Not applicable
Author

Something like this could work, I think:

=yearstart(addmonths(max(Datefield),-12))