Expand my Community achievements bar.

Applications for the Community Advisor Program Class of 2025 are NOW OPEN – Apply Today!
SOLVED

round the percent

Avatar

Level 6

Hi team, 

 

Is there a way to round the decimal points for the function below:

(percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*100

I tried adding round:

round((percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*100, 2)

but it throws an error saying that the round function requires 2 or 3 arguments. Please suggest how I can achieve this.

<node expr="(percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*100" alias="@OpenRate"/>

Thank you in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 6

Hi @Sukrity_Wadhwa ,

 

I was able to sort this out by using the below expression:

 <node expr="ToInteger((Percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*1000)/10" alias="@OpenRate"/>
   <node expr="ToInteger((Percent([indicators/@recipientClick], [indicators/@estimatedRecipientOpen]))*1000)/10" alias="@ClickRate"/> 

Thank you

View solution in original post

6 Replies

Avatar

Level 7

Try using this expresion in the expr field

Round(<number>, <number of decimals>)

 

Source:
https://experienceleague.adobe.com/en/docs/campaign-standard/using/managing-processes-and-data/filte...

Avatar

Community Advisor

hHi @rvnth ,

 

Please try this way and let me know if it works

 

Round((Percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*100, 2)

 

Regards,

Pravallika.

Avatar

Level 6

Hi @LakshmiPravallika ,

 

Thank you. It worked, but for one delivery, the decimal is still not rounding off to two decimal places. Please advise.

 

rvnth_0-1718096210524.png

 

 

Avatar

Administrator

Hi @LakshmiPravallika,

Could you please help @rvnth further here?

Thanks!



Sukrity Wadhwa

Avatar

Correct answer by
Level 6

Hi @Sukrity_Wadhwa ,

 

I was able to sort this out by using the below expression:

 <node expr="ToInteger((Percent([indicators/@estimatedRecipientOpen],[indicators/@successWithoutSeeds]))*1000)/10" alias="@OpenRate"/>
   <node expr="ToInteger((Percent([indicators/@recipientClick], [indicators/@estimatedRecipientOpen]))*1000)/10" alias="@ClickRate"/> 

Thank you

Avatar

Administrator

Thanks @rvnth for sharing your solution.



Sukrity Wadhwa