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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Gaz4OakM
Contributor
Contributor

Cumulative ignoring filter but it in expression

I been searching for a long time and hoping someone can help, im trying to get separate KPI boxes for week, period and YTD and im struggling to get period when i select on a given week.

I have dashboard where i can select week number i.e week 4, the ending date for this week would be 28/04/2019 (transaction date).

What im trying to do is get YTD sales as at Week 4 based on the month number based off the week selected, so if i use 

=sum({< [Week No]=,month = {4}>} sales)

i get the same answer if i select week 4 or week 5, which is all sales YTD, however when i select week 5 i would only want to see month 5 sales

 

 

3 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Gaz,

The reason you are getting the same answers for 4 / 5 is because the week selection is not working anymore. This is because you have excluded it in your set analysis. Also your 'YTD' sales is probably not YTD if you forced Month 4, rather a Month To Date (MTD). 

If you want YTD sales, you should create an indicator in your calendar with the following function:

let vToday = floor(today());
If(Date <= $(vToday),1,0) as _indYTD

// use this in the front-end
Sum({$< _indYTD = {1}>} sales)

I don't really get your point in selecting week 5 and getting values for month 5? Because we're in week 18 now and that his month 5. Or did you mean selecting month 5? 

Jordy

Climber

 

Work smarter, not harder
Gaz4OakM
Contributor
Contributor
Author

thanks for your response, i think given your answer i might be well out of my depth, in answer to you questions and probably should have clarified, financial year starts April. so hence Week 5 is in April.

JordyWegman
Partner - Master
Partner - Master

Good to know that we are talking about a financial calendar. But about your selections. You have three KPIs. What are the formulas? 

TableKPI WeekKPI PeriodKPI YTD
Formula   

 

Can you give an example what you expect for each KPI when you first select week 4 and then week 5?

TableKPI WeekKPI PeriodKPI YTD
Week 4   
Week 5   

 

Jordy

Climber

Work smarter, not harder