Quote:
Originally Posted by Marco24
1rst example :
if #genre contains SF or Fantasy or Weird then populate the column with SFFF else empty
|
Try this
General Program Mode template:
Code:
program:
test(list_intersection('SF, Fantasy, Weird', field('#genre'), ','), 'SFFF', '')
Quote:
another example of test I want to realize :
if #nationalite not in (fr, ca) and #translator is null and #VO-title is null
then #customcolumn = "translation data missing"
else empty
|
Code:
program:
test(
strcat(
list_intersection('fr, ca', field('#nationalite'), ','),
field('#translator'),
field('#VO-title')
),
'', 'translation data missing')
NB: I can't test this template because I don't have the three columns it references.
The template produces output only if the three expressions produce an empty value, determined by concatenating the results of the three expressions.
- The first, the list_intersection, produces a non-empty value if the field contains one of the two nationalities.
- The second produces a non-empty value if #translator contains a value.
- The second produces a non-empty value if #VO-title contain a value.
If the strcat is non-empty (any of the expressions returned a value) then the test produces empty.
In effect, the template implements your expression altered using
De Morgan's Laws
Code:
if not (#nationalite in (fr, ca) or #translator is not null or #VO-title is not null)
then "translation data missing"
else empty