Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Wayne_101
Contributor III
Contributor III

RANGE FILTERS

Hi

 

 

 

 

 

 

 

24 Replies
andoryuu
Creator III
Creator III

You need to change your customer_id dimension to be the following:

=aggr(Only({<[CUSTOMER_ID]={"=((SUM(MO) >= $(vMinMO) and SUM(MO) <= $(vMaxMO)) or (SUM(RC) >= $(vMinRC) AND SUM(RC) <= $(vMaxRC)))"}>}[CUSTOMER_ID]),[CUSTOMER_ID])

Then set your MO and RC fields to simply be SUM(MO) and SUM(RC).  This should solve the issue.  Changes applied to your sample attached.

Rodj
Luminary Alumni
Luminary Alumni

Sorry @Wayne_101 , it occurred to me late last night that that my solution was only going to work for one measure and you wanted it to work for more than one, I'm trying to do too many things at once! Looks like @andoryuu  has it sorted for you now though. Good luck!

Wayne_101
Contributor III
Contributor III
Author

hi,

@andoryuu 

the above shared logic doesn't work .

slider doesn't filter the data in ranges as seen in below images.

 

lets say :

eg :i want to see my customer who have MO between 200 and 300 plus having RC between 1000 and 3000

 

new_2.PNG

 

new_1.PNG

 

Saryk
Partner - Creator II
Partner - Creator II

This :

 

= If (MO>= $(vMinMous) AND MO<= $(vMaxMous)
or If RC>= $(vMinRC) AND RC<= $(vMaxRC),Customer_ID)

 

should be this (easily expanded) :

 

= If (
(MO>= $(vMinMous) AND MO<= $(vMaxMous)) AND
(RC>= $(vMinRC) AND RC<= $(vMaxRC)),
Customer_ID)

 

Also, you don't need the filter on your measures, only on the dimensions.

Saryk
Partner - Creator II
Partner - Creator II

I posted an answer but it was reported as spam for some reason.

Your dimension's IF condition doesn't work, here's a working version of your file. 

 

Wayne_101
Contributor III
Contributor III
Author

@Saryk 

it works perfectly fine , just one last thing how can i make it work with count(distinct customer_id)

what you suggested for dimension

=if(
(MO >= $(vMinMO) and MO <= $(vMaxMO)) and
(RC >= $(vMinRC) AND RC <= $(vMaxRC))
,CUSTOMER_ID)

what you suggested for Measure

=if(Aggr(sum(RC)>= $(vMinRC), CUSTOMER_ID) and Aggr(sum(RC) <= $(vMaxRC),CUSTOMER_ID),sum(RC))

 

logic i want to use for dimension :

=if(
(MO >= $(vMinMO) and MO <= $(vMaxMO)) and
(RC >= $(vMinRC) AND RC <= $(vMaxRC))
,count(distinct CUSTOMER_ID))

andoryuu
Creator III
Creator III

It works based on your logic.  You have them specified as or statements.  everything you circled falls into EITHER the MO OR the RC band.  If you want it to be the intersection, just change OR to AND.

andoryuu
Creator III
Creator III

@Saryk  Filtering on measures was removed in my reply back.

Saryk
Partner - Creator II
Partner - Creator II

My bad, I didn't check the measures in the file I sent you back.

You can actually change them to =sum(MO) and =sum(RC) because the filtering is already done in the dimension.

 

Wayne_101
Contributor III
Contributor III
Author

Please look into my above use case , what if i want count distinct of
customers falling between my rc and mo ranges