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: 
khanashique
Creator II
Creator II

Set Expression Month Condition

Hi Experts,

I am facing an issue in the following looking numbers for last month, while adding the set expression in graph:

Dimension = Date

Measure = Sum({<Category = {'Books'},Month = {"$(=Month(Today())-1)"}>}OrderQty)

 

Thanks,

MAK.

Labels (2)
15 Replies
Channa
Specialist III
Specialist III

bro you have date-

just do date(date,'mm/dd/yyyy')

just use below

vMonthStart=monthstart(AddMonths(Today(),-1))

vMonthEnd=monthend(AddMonths(Today(),-1))

 

Measure = Sum({<Category = {'Books'},date ={">=$(vMonthStart)<=$(vMonthEnd)"}>} >}OrderQty)

Channa
pradosh_thakur
Master II
Master II

Hi @khanashique 

 

With your sample data this will work.

= Sum({<Category = {'Book'},DATE ={"=month(today()-30)=Month(DATE)"}>} OrderQTY)
Learning never stops.
pradosh_thakur
Master II
Master II

This will work as well

= Sum({<Category = {'Book'},DATE ={"=month(addmonths(today(),-1))=Month(DATE)"}>} OrderQTY)

Things to note

Your category is 'Book' and not 'Books' in the sample data. OrderQTY is not OrderQty and please check your date field name.

Let me know if you need qvf as well.

 

Learning never stops.
Channa
Specialist III
Specialist III

I attach  qvF

i get 8852000

Channa
khanashique
Creator II
Creator II
Author

Thanks Pradosh....the expression given by you worked...

khanashique
Creator II
Creator II
Author

Thanks Channa...