6 Replies Latest reply: Oct 10, 2018 3:09 AM by David Štorek

# 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)

Janani

• ###### Re: Greater than or less than a Variable in set analysis

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)

• ###### Re: Greater than or less than a Variable in set analysis

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

• ###### Re: Greater than or less than a Variable in set analysis

Hi,

FYR.

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

(intersection between section and current year)

Or this:

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

Thanks.

• ###### Re: Greater than or less than a Variable in set analysis

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.

• ###### Re: Greater than or less than a Variable in set analysis

May be this:

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

• ###### Re: Greater than or less than a Variable in set analysis

Hi, this did not work either for me

Thanks

Janani

• ###### Re: Greater than or less than a Variable in set analysis

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)

• ###### Re: Greater than or less than a Variable in set analysis

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.