Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
joeybird
Creator III
Creator III

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
tresesco
MVP
MVP

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)

View solution in original post

13 Replies
Not applicable

try <MonthStart(Today())

instead of -=Month(getdate())

tresesco
MVP
MVP

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)

Kushal_Chawda

try

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

joeybird
Creator III
Creator III
Author

Hiya

brill thanks Tresesco  !

and team too

Kind Regards

joeybird
Creator III
Creator III
Author

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

tresesco
MVP
MVP

Try like:

Dimension: Month

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

joeybird
Creator III
Creator III
Author

Hiya

no joy with the above, any more ideas

just get -

please help

Not applicable

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



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

joeybird
Creator III
Creator III
Author

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