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: 
jananireddy
Partner - Creator
Partner - Creator

Greater than or less than a Variable in set analysis

Hello,

I am trying to do a condition to achieve results greater than and less than a particular period (In the format YYYY-MM)

count({<Sales_Month_Year ={">=$(=vMinSalesPeriod)<=$(=vMaxSalesPeriod)"}>} ID)

This does not work for me. My data looks this way:

Sales_Month_Year

2018-01

2018-02

.

.

and so on

And the Variable are captured in the format same format. How ever this works for me

count({<Sales_Month_Year = {"=$(vMinSalesPeriod)"}>}VIN)

But the moment i put a greater sign in that statement it shows 0 records

count({<Sales_Month_Year = {">=$(vMinSalesPeriod)"}>}VIN)



Thanks in advance

Janani


8 Replies
Nicole-Smith

What about without the extra = signs in the dollar sign expansion?

count({<Sales_Month_Year ={">=$(vMinSalesPeriod)<=$(vMaxSalesPeriod)"}>} ID)


Also, maybe try wrapping the dollar sign expansions in single quotes if your variable value is a string:

count({<Sales_Month_Year ={">='$(vMinSalesPeriod)'<='$(vMaxSalesPeriod)'"}>} ID)

jomar_ebonite
Partner - Contributor III
Partner - Contributor III

Hi,

FYR.

=Sum({$<Year = {">=2013 <=2015"}>} Amount)

(intersection between section and current year)

Or this:

Sum({$<Year = {">=2013 <=$(=Year(Today())-2)"}>} amount)


Thanks.

balabhaskarqlik

May be this:

count({<Sales_Month_Year ={">=$(=$(vMinSalesPeriod))<=$(=$(vMaxSalesPeriod))"}>} ID)

jananireddy
Partner - Creator
Partner - Creator
Author

Thanks Jomar, Helps me realize one thing with this

count({$<Sales_Month_Year = {'>=2018-02 <=2018-10'}>} VIN)

This does not work for me, seems like a format issue.

jananireddy
Partner - Creator
Partner - Creator
Author

Hi Nicole, I am using something as basic as this expression to check if the format is being read correctly

count({$<Sales_Month_Year = {">='2018-02'"}>} VIN)


Does the above statement make sense, I have passed the period in quotes but does not work

jananireddy
Partner - Creator
Partner - Creator
Author

Hi, this did not work either for me

Thanks

Janani

jananireddy
Partner - Creator
Partner - Creator
Author

Hi Guys,

I am still trying to understand why does this work for me

count({$<Sales_Month_Year = {'=2018-10'}>} VIN)

and this doesn't

count({$<Sales_Month_Year = {'>=2018-10'}>} VIN)

DavidŠtorek
Creator III
Creator III

Hi,

is field Sales_Month_Year string or is it number? It seems that it is probably string because than it is not possible to make >= comparison.