4 Replies Latest reply: Oct 16, 2015 11:30 AM by Jonathan Poole

# 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

• ###### Re: Minus select months - qlik sense

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)

• ###### Re: Minus select months - qlik sense

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,

• ###### Re: Minus select months - qlik sense

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

• ###### Re: Minus select months - qlik sense

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)