Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

Minus select months - qlik sense

Hiya

I have a expression as follows

count({$< Delivery_Date-= {"$(='>=' & Date(MonthStart(Today())) & '<=' & Date(MonthEnd(Today())))"} >}Customer_ID)

This calculation works great to minus current month (oct 2015) delivery date data.

however

I have a bar chart that shows dimension week beginning (Order_Week)

How do I amend the calculation above so that if the week beginning is e.g September , it will minus any (October 2015) delivery date data + (September 2015) delivery date data

please help

4 Replies
JonnyPoole
Employee
Employee

If the week begins in the prior month and you want that week bucket to include the days in that week from the prior month, try using the weekstart() function to take the monthstart date and push the date back to the first day of that day's week:

count({$< Delivery_Date-= {"$(='>=' & Date(WeekStart(MonthStart(Today()))) & '<=' & Date(MonthEnd(Today())))"} >}Customer_ID)

joeybird
Creator III
Creator III
Author

Hiya

no joy with this one, Week Beginning Septembers dates remains the same no change, but Week Beginning Octobers dates, its taking off Septembers delivery dates too as well as October,

please help

joeybird
Creator III
Creator III
Author

Hiya

is there a way of an expression that if Week beginning Date

21/09/2015, has the Month of September

it excludes any customers that have Delivery dates in September

and so on

21/08/2015, has the Month of August

it excludes any customers that have Delivery dates in August

please help

JonnyPoole
Employee
Employee

Joanna - i put some sample data together in a table that is shown below on the left. Some data spans different months but falls in the same week.

In the title of each chart you can see the set analysis. 

My syntax is a little different to yours. Do you want to check that next ?  i can share the app too if you need

Sum( {$-<Delivery_Date={">=$(=Weekstart(MonthStart(Today())))<=$(=Today())"}>} Sales)

Capture.PNG