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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Bar chart

Need help with one bar chart where i need to show last 12 months sales (dynamic) and YTD sales.  If i select any month it should show me the sales for last 12 months as per my selection and YTD sales from that month.

attached is the sample file.

Hope someone can help me with the set analysis

3 Replies
vikasgupta
Creator
Creator

Hi try this

(sum({<CalendarDate = {">=$(=num(Yearstart(max(CalendarDate))))<=$(=max(CalendarDate))"},CalendarMonthName=,CalendarQuarter=,Week=>}Sales))

this  will give you yearly YTD on sales .

Thanks

Vikas

Not applicable
Author

tried something like this but not working....can u post some sample file...... i need YTD sales to be dynamic.....if i select any month it should show me YTD sales as per that monts and also last 12 month sales from that month....

vikasgupta
Creator
Creator

hi

this is my working expression

(sum({<InvoiceDate = {">=$(=Date(Yearstart(max(InvoiceDate))))<=$(=max(InvoiceDate))"},IMonth=>}{$<RmCtg={'G'}>}(IrRmIWt*RmPurityWt)/0.995)))))

Bold syntax is calculated YTD and second part is what we wants to sum .

Thanks

Vikas