Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Indirect Set Analysis and Greater Than

Hello all.

Concept:

I have a document containing various information about clients, sales, etc.

As part of my load, I also have a separate data construct called protocols, which are not directly linked to clients/etc. but contain a set of metric definitions.

In this example, I am needing to pull all Clients from the current selection who have a Age within the bounds specified by ProtocolGroup_ID = 1.

The following expression works:

=count({$<ClientAge=P({1<ProtocolGroup_ID={'1'}>}AgeMin)>} DISTINCT ClientID)

The expression above works to provide a count of all Clients in current selection who have an age matching the AgeMin value designated by the ProtocolGroup_ID. I need it to provide a count of all Clients who have an age Greater Than or Equal to the AgeMin value.

I have been unable to get it working.

Any insight would be most appreciated.

Thank you in advance for your time and consideration.


1 Solution

Accepted Solutions
Not applicable
Author

=count({$<ClientAge = {">=$(=only({1<ProtocolGroup_ID={1}>} AgeMin))"} >} DISTINCT ClientId)

that should be correct, if the AgeMin is not a variable but a with same value of field or single value only

View solution in original post

10 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Try with this expression..

         

     =count({$<ProtocolGroup_ID={'1'},ClientAge={"<=$(AgeMin)"}>} DISTINCT ClientID)

Hope this is your need

Celambarasan

Not applicable
Author

Hey Celambarasan.

Thanks for the help.

Unfortunately, that won't work because the ProtocolGroup_ID has nothing to do with the current selection.

If I use the expression you provided, I get the full count of Distinct ClientIDs in my selection, not restricted by age.

Not applicable
Author

Hi,

Try this! It should work, if I understood it correctly.

count(DISTINCT {<Age={"<=$(=max({<protocol={'g3'}>}agemin))"}>}ClientID)

...

Ashutosh

Not applicable
Author

just change field names according to your fields.

swuehl
MVP
MVP

So your AgeMin is an unambiguous single value? Maybe you could use

=count({$<ClientAge = {">=$(=only({1<ProtocolGroup_ID={1}>} AgeMin))"} >} DISTINCT ClientID)

Not applicable
Author

oh yes...I did not notice that he wanted greater than or equal to. So what i wrote earlier should be changed to 

count(DISTINCT {<Age={">=$(=max({<protocol={'g3'}>}agemin))"}>}ClientID)

or may be only can also be used but I will personally prefer max.


count(DISTINCT {<Age={">=$(=only({<protocol={'g3'}>}agemin))"}>}ClientID)

...

Thanks

Ashutosh

Not applicable
Author

Hi,

what i understood this may help you

let say between 1 to 12 :

=count({$<ClientAge=P({1<ProtocolGroup_ID={'>=1<=12'}>}AgeMin)>} DISTINCT ClientID)



====Else you can Create a Variable and pass instead of Numbers ==========================


=count({$<ClientAge=P({1<ProtocolGroup_ID={">=$(vMin) <=$(vMax)"}>}AgeMin)>} DISTINCT ClientID)


Not applicable
Author

=count({$<ClientAge = {">=$(=only({1<ProtocolGroup_ID={1}>} AgeMin))"} >} DISTINCT ClientId)

that should be correct, if the AgeMin is not a variable but a with same value of field or single value only

Not applicable
Author

Hey Dwi.

Your code is spot on and works great. Thanks!

What would I need to modify so that the count is for ClientAge >= AgeMin and ClientAge <= AgeMax?