13 Replies Latest reply: Oct 13, 2015 9:11 AM by Joanna Seldon

exclude current month

Hiya

have a kpi

I am trying to write something like this

sum({\$< Order_Date -={\$(Month(getdate()))}  >}Customer_ID)

I wish to exclude this months 'October 2015'  (When this post was written)  orders for customers

where am I going wrong

• Re: exclude current month

try <MonthStart(Today())

• Re: exclude current month

You can't compare date field with month value. Rather, create a month field in the script (if already not there) and try expression like:

Month(Oredr_Date) as Month,

....

sum({\$< Month -={\$(=Month(today()))}  >}Customer_ID)

• Re: exclude current month

Hiya

brill thanks Tresesco  !

and team too

Kind Regards

• Re: exclude current month

try

=sum({\$< Order_Date ={"<\$(=monthstart(max(Order_Date )))"} >}Customer_ID)

• Re: exclude current month

sum({\$< Month -={\$(=Month(today()))}  >}Customer_ID)

how can this be altered to show for previous months?

so plot total against each month of the year?

• Re: exclude current month

Try like:

Dimension: Month

Exp: sum({\$< Order_Date ={'\$(>=YearStart(Today())<=MonthEnd(Today(),-1))'}  >}Customer_ID)

• Re: exclude current month

Hiya

no joy with the above, any more ideas

just get -

• Re: exclude current month

think i've got all the brackets in the right places!

• Re: exclude current month

hiya

I think its an issue with my master calendar

need to re-arrange this please some how

I have come close with this

count({\$< [Order_Date.Calendar.Month] ={\$(=Month(today()))}  >}Customer_ID)   e.g I get 10

the logic would say count({\$< [Order_Date.Calendar.Month] -={\$(=Month(today()))}  >}Customer_ID) but I get 0

• Re: exclude current month

AddMonths(today(),-1) will give you last month.

caution though - the Month function will take out the Year portion - so if you have more than a years worth of data, it will look at multiple Septembers....

• Re: exclude current month

Hiya

this still returns the value of 0

I try this, but it does not seem to minus order dates for this month

COUNT({\$< Order_Date -= {\$(=Month(today()))}>}Customer_ID)

what can be wrong?

• Re: exclude current month

hello

does: