Can you use a CASE statement in a Stepper Reference Selection Picker Filter?
M
Michael BARTLEY
started a topic
over 1 year ago
hi there,
I am using a reference selection picker filter in my stepper.
The following two statements work fine on their own:
1) Referenced.Country.ID = 'AU'
2) Referenced.PL_REGION.PL_Region IS NOT NULL
Ideally id like to do something like the following within my picker filter reference selection:
CASE
WHEN Record.DistGrp_CVC.FID_Country = 'AU'
THEN (Referenced.Country.ID = 'AU' AND Referenced.FID_PL_REGION IS NOT NULL)
ELSE Referenced.PL_REGION.PL_Region IS NOT NULL
END
The ELSE statement works by itself, and the two statements in the THEN statement work individually.
Is it possible to use a case statement in a picker filter? If so, any suggestions on my SEMQL? Thank you
Best Answer
M
Matthieu DE PILLOT DE COLIGNY
said
over 1 year ago
Hello
A case when statement can't be interpreted as a boolean, as it can return anything. The easiest way to make sure your case when statement is interpreted as a boolean is to add an '=1' at the end of it, something like : case [...] end =1
Also as your case when looks simple, it may be converted to a combination of AND and OR instead, that would guarantee it will be interpreted as a boolean, something like:
(Record.DistGrp_CVC.FID_Country = 'AU' AND Referenced.Country.ID = 'AU' AND Referenced.FID_PL_REGION IS NOT NULL)
OR
(Record.DistGrp_CVC.FID_Country <> 'AU' AND Referenced.PL_REGION.PL_Region IS NOT NULL)
1 Comment
M
Matthieu DE PILLOT DE COLIGNY
said
over 1 year ago
Answer
Hello
A case when statement can't be interpreted as a boolean, as it can return anything. The easiest way to make sure your case when statement is interpreted as a boolean is to add an '=1' at the end of it, something like : case [...] end =1
Also as your case when looks simple, it may be converted to a combination of AND and OR instead, that would guarantee it will be interpreted as a boolean, something like:
(Record.DistGrp_CVC.FID_Country = 'AU' AND Referenced.Country.ID = 'AU' AND Referenced.FID_PL_REGION IS NOT NULL)
OR
(Record.DistGrp_CVC.FID_Country <> 'AU' AND Referenced.PL_REGION.PL_Region IS NOT NULL)
Michael BARTLEY
hi there,
I am using a reference selection picker filter in my stepper.
The following two statements work fine on their own:
1) Referenced.Country.ID = 'AU'
2) Referenced.PL_REGION.PL_Region IS NOT NULL
Ideally id like to do something like the following within my picker filter reference selection:
CASE
WHEN Record.DistGrp_CVC.FID_Country = 'AU'
THEN (Referenced.Country.ID = 'AU' AND Referenced.FID_PL_REGION IS NOT NULL)
ELSE Referenced.PL_REGION.PL_Region IS NOT NULL
END
The ELSE statement works by itself, and the two statements in the THEN statement work individually.
Is it possible to use a case statement in a picker filter? If so, any suggestions on my SEMQL? Thank you
Hello
A case when statement can't be interpreted as a boolean, as it can return anything.
The easiest way to make sure your case when statement is interpreted as a boolean is to add an '=1' at the end of it, something like : case [...] end =1
Also as your case when looks simple, it may be converted to a combination of AND and OR instead, that would guarantee it will be interpreted as a boolean, something like:
Matthieu DE PILLOT DE COLIGNY
Hello
A case when statement can't be interpreted as a boolean, as it can return anything.
The easiest way to make sure your case when statement is interpreted as a boolean is to add an '=1' at the end of it, something like : case [...] end =1
Also as your case when looks simple, it may be converted to a combination of AND and OR instead, that would guarantee it will be interpreted as a boolean, something like:
-
Extend a model with new entities or attributes
-
Data types in xDM
-
Effective date on entities
-
Search using wild cards
-
Export a model from production and import on a development environment
-
"Allow Delete" vs "Allow Removal" privileges
-
LOV label in Named Query
-
Select location on a map and save coordinates
-
Is there a way to set up a master-detail relationship on browse mode?
-
Choose Either a Stepper or A Workflow Based on The User Privileges
See all 346 topics