Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

joeybird
Contributor II

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

please help

1 Solution

Accepted Solutions
MVP
MVP

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:

Load

          Month(Oredr_Date) as Month,

          ....

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

13 Replies
Not applicable

Re: exclude current month

try <MonthStart(Today())

instead of -=Month(getdate())

MVP
MVP

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:

Load

          Month(Oredr_Date) as Month,

          ....

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

Re: exclude current month

try

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

joeybird
Contributor II

Re: exclude current month

Hiya

brill thanks Tresesco  !

and team too

Kind Regards

joeybird
Contributor II

Re: exclude current month

Have got additional issue

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?

please help

MVP
MVP

Re: exclude current month

Try like:

Dimension: Month

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

joeybird
Contributor II

Re: exclude current month

Hiya

no joy with the above, any more ideas

just get -

please help

Not applicable

Re: exclude current month

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



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

joeybird
Contributor II

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

please help

Community Browser