Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jstemig1
Contributor II
Contributor II

Dynamic Implicit Field Value?

Hello,

I'm trying to use the P() function to limit values, based on a dynamic input.

Using the example from the Reference Manual below, I want to use the result of GetFieldSelections(), instead of 'Shoe'. 

Example from the manual:

sum( {$<Customer = P({1<Product= {‘Shoe’} >} Customer)>} Sales )  

Desired expression:

sum( {$<Customer = P({1<Product=  GetFieldSelections(Product) >} Customer)>} Sales ) 

Is this possible??  I've also tried using a variable in place of the local GetFieldSelections() function, but no dice there either. 

What I'm really trying to do is get a count of orders that are were placed by any provider who belongs to a certain specialty, based on the single provider selected at the time.

E.g. if I have selected Joe Doctor, I want to know how many orders Joe and the other Providers in his specialty have placed. 

This works:

count( {$<PrimarySpecialtyNM = P({$<ProviderFullNM= {'Doctor, Joe'} >} PrimarySpecialtyNM)

            , ProviderFullNM =

        >} EpicOrderID )

This doesn't:

count( {$<PrimarySpecialtyNM = P({$<ProviderFullNM= GetFieldSelections(ProviderFullNM) >} PrimarySpecialtyNM)

            , ProviderFullNM =

        >} EpicOrderID )

Thanks!

Joe

1 Solution

Accepted Solutions
Nicole-Smith

Try this:

sum( {$<Customer = P({1<Product={$(=concat(distinct chr(39) & Product & chr(39), ','))}>} Customer)>} Sales )

count( {$<PrimarySpecialtyNM = P({$<ProviderFullNM={$(=concat(distinct chr(39) & ProviderFullNM & chr(39), ','))}>} PrimarySpecialtyNM)

            , ProviderFullNM =

        >} EpicOrderID )

View solution in original post

3 Replies
Nicole-Smith

Try this:

sum( {$<Customer = P({1<Product={$(=concat(distinct chr(39) & Product & chr(39), ','))}>} Customer)>} Sales )

count( {$<PrimarySpecialtyNM = P({$<ProviderFullNM={$(=concat(distinct chr(39) & ProviderFullNM & chr(39), ','))}>} PrimarySpecialtyNM)

            , ProviderFullNM =

        >} EpicOrderID )

maxgro
MVP
MVP

maybe

count( {$<PrimarySpecialtyNM = P({$< ProviderFullNM={$(=concat(ProviderFullNM, ','))}  >} PrimarySpecialtyNM)

            , ProviderFullNM =

        >} EpicOrderID )

jstemig1
Contributor II
Contributor II
Author

Wow, wouldn't have gotten there myself, thanks Nicole!