Multiple If condition for Data prep | Community
Skip to main content
Level 2
June 12, 2024
Solved

Multiple If condition for Data prep

  • June 12, 2024
  • 1 reply
  • 704 views

Hi,

in my project I need to write the event type field in my XDM schema using data prep on source attribute.

The problem is that, the condition are multiple.

For example :

iif(statuscode == 'open' && status == 'option' && isPostponed == 'false', 'newoption', 'undefined')

In the same flow I have other condition to write the same event type field:

iif(statuscode == 'open' && status == 'optioned' && isPostponed == 'true', 'optionextended', 'undefined')

How can I write a single condition?

 

Thank you very much.

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 Ankit_Chaudhary

Hi @user36079 

I haven't came across such use case yet, but you can try nesting the second iif condition into first one.

 

iif( statuscode == 'open' && status == 'option' && isPostponed == 'false', 'newoption', iif( statuscode == 'open' && status == 'optioned' && isPostponed == 'true', 'optionextended', 'undefined' ) )

 

1 reply

Ankit_Chaudhary
Community Advisor
Ankit_ChaudharyCommunity AdvisorAccepted solution
Community Advisor
June 13, 2024

Hi @user36079 

I haven't came across such use case yet, but you can try nesting the second iif condition into first one.

 

iif( statuscode == 'open' && status == 'option' && isPostponed == 'false', 'newoption', iif( statuscode == 'open' && status == 'optioned' && isPostponed == 'true', 'optionextended', 'undefined' ) )