Is there any doc on IIF usage? | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DimaKudryavtsev

Hi

There is no good manual for this function, but it is very basic and intuitive.

It looks like Iif(<expression>,<if expression truly, do this>,<otherways do that>)

Expressions can be any valid XTK expression, for example:

Iif(@myValue=1 and [nested/@value] >=2, "YES". "NO")

The following comparison operators are supported:

=, >, <, >=, <=, !=, IN, LIKE, NOT, IS NULL

Actions also can be anything, even another Iif() function. Ultimately, Iif will be converted to SQL expression CASE WHEN ... THEN ... ELSE ... END

p.s here are some resources:

Defining filter conditions

Advanced expression editing

4 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
August 6, 2019

Hi,

The Iif() sql expression? It's documented in its call:

This is analogous to decode() in Oracle:

Thanks,

-Jon

mustafau3722362
Level 2
August 6, 2019

Thanks for the page wodnicki,

before I write here I saw that page.

The page does not provide real-life use cases and syntax for Adobe campaign.

Do you know any resource that shows various codes?

DimaKudryavtsev
DimaKudryavtsevAccepted solution
Level 3
August 7, 2019

Hi

There is no good manual for this function, but it is very basic and intuitive.

It looks like Iif(<expression>,<if expression truly, do this>,<otherways do that>)

Expressions can be any valid XTK expression, for example:

Iif(@myValue=1 and [nested/@value] >=2, "YES". "NO")

The following comparison operators are supported:

=, >, <, >=, <=, !=, IN, LIKE, NOT, IS NULL

Actions also can be anything, even another Iif() function. Ultimately, Iif will be converted to SQL expression CASE WHEN ... THEN ... ELSE ... END

p.s here are some resources:

Defining filter conditions

Advanced expression editing

mustafau3722362
Level 2
August 9, 2019