Skip to main content
I have a script setup where I want to show two separate values in the same line of HTML. Sometimes the values will be equal. So instead of showing a duplicate I need to write a function to display just the second value. 

 

Is there a function that can do this? Can't find any documentation on it. 

 

I've tried this already. 

 

%%=IIf(@Value1=@Value2),(%%=v(@Value2=%%)),(%%=v(@Value1)=%% %%=v(@Value2)=%%)=%%
1 Antwort
  1. 17. Nov. 2017, 17:26
    You should be able to do an OR check:

     

     

    %%[ IF @Value1 == @Value2 OR @ VALUE1 > @VALUE2 THEN ]%%

    %%=v(@Value1)=%%

    %%[ELSE]%%

    %%=v(@Value2)=%%

    ​%%[ENDIF]%%

     

    However, if your first and second value are equal, it doesn't really matter which value you output because they'll both be the same.
0/9000