if and else if statement syntax for an expression in enrichment activity | Community
Skip to main content
Level 3
January 20, 2024
Solved

if and else if statement syntax for an expression in enrichment activity

  • January 20, 2024
  • 1 reply
  • 1475 views

Hi All,

 

Could anyone please help on "if and else if statement syntax" used in an expression in enrichment activity?

 

Thank you,

Rutuja Kelkar

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 Amine_Abedour

Hello @rut7,

 

Let say you want to do the equivalent of :

if (@gender == 1){ logInfo('Male'); } else if (@gender == 2){ logInfo('Female'); } else { logInfo('unknown'); }

 

That would be :

 

Iif(@gender = 1,'Male',Iif(@gender = 2,'Female' ,'unknown'))

 

Br,

Amine

1 reply

Amine_Abedour
Community Advisor
Amine_AbedourCommunity AdvisorAccepted solution
Community Advisor
January 20, 2024

Hello @rut7,

 

Let say you want to do the equivalent of :

if (@gender == 1){ logInfo('Male'); } else if (@gender == 2){ logInfo('Female'); } else { logInfo('unknown'); }

 

That would be :

 

Iif(@gender = 1,'Male',Iif(@gender = 2,'Female' ,'unknown'))

 

Br,

Amine

Amine ABEDOUR