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:
-
LOV label in Named Query
-
How we can set Dynamically changing Form field Description?
-
Is it possible to have a conditional survivorship rule based on a SemQL filter (akin to the filter on privileges)?
-
Where Do I View 2 Merged Records?
-
Show/hide an attribute in a form
-
Restrict access of attributes
-
Is it possible to manage visible/invisible value in List depend on user role??
-
Why am I unable to merge duplicates?
-
How are child records selected when parent records are manually merged?
-
Can the response from the API Call Response can be formatted differently in the JSON output?
See all 178 topics