Can not get a blank result in $if $eql statement

Format Value:
CONTENTGROUP
$if($eql(%itunesadvisory%,1),Explicit,%contentgroup%),$if($eql(%itunesadvisory%,2),Clean,%contentgroup%),$if($eql(%itunesadvisory%,0), ,%contentgroup%)

Desired outcomes:
CONTENTGROUP
Explicit, Clean, *blank*

I can't seem to get the $if($eql(%itunesadvisory%,0), ,%contentgroup%) to work.
No matter what I try, even if I leave that if statement off, I can't get a blank result in CONTENTGROUP. I get ,, , ,,

With Format Value:
CONTENTGROUP
$if($eql(%itunesadvisory%,1),Explicit,%contentgroup%),$if($eql(%itunesadvisory%,2),Clean,%contentgroup%)

Result CONTENTGROUP:
,

With Format Value:
CONTENTGROUP
$if($eql(%itunesadvisory%,1),Explicit,%contentgroup%),$if($eql(%itunesadvisory%,2),Clean,%contentgroup%),$if($eql(%itunesadvisory%,0),,%contentgroup%)

Result CONTENTGROUP:
,,

If you check ITUNESADVISORY then I doubt that it can have 2 (or even 3) values at the same time.
First check is ITUNESADVISORY = 1 results in "Explicit" - the second and third condition will produce that what is already in CONTENTGROUP plus the commas.
-> Explicit,,
Second check is ITUNESADVISORY = 2 results in "Clean" - the first and third condition will produce that what is already in CONTENTGROUP plus a leading comma.
->,Clean,
The third check is ITUNESADVISORY = 0 results in " " - the first and second condition will produce that what is already in CONTENTGROUP plus commas.
->,,_
All together: this will never lead to

Perhaps you have to include the comma in the result string, e.g.
$if($eql(%itunesadvisory%,1),"Explicit,",%contentgroup%)
but as only one condition of the 3 will lead to a positive result, I doubt that you need the comma at all, you will not get a list that needs to be separated.

I think I need to clarify.

ITUNESADVISORY can only have one value 0,1 or 2.
Therefore, CONTENTGROUP should only have one value Clean, Explicit or no value. And should not append any other values.

I hope this is more helpful.

You can type all $if()-clauses behind each other, no need to use a separating comma.

Try this:
$if($eql(%itunesadvisory%,1),Explicit,$if($eql(%itunesadvisory%,2),Clean,))

Thankyou. This worked perfectally!
:grin:

1 Like