Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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 )
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 )
maybe
count( {$<PrimarySpecialtyNM = P({$< ProviderFullNM={$(=concat(ProviderFullNM, ','))} >} PrimarySpecialtyNM)
, ProviderFullNM =
>} EpicOrderID )
Wow, wouldn't have gotten there myself, thanks Nicole!