Can you round scoring calculations in embedded data? | XM Community
Skip to main content

Hi All, 

 

I am adding some embedded data to calculate the percentage of a score. I use the following for the value of the embedded data field with the piped text in that calculation being the piped text for the scoring:

$e{ ( gr://SC_emoKcRxLvqHeFTw/Score / 3 ) * 100 } 

Is there anything I can add here, so the results would be rounded when included in my report? I saw some folks discussing some things in the developer forums, but it was not quite in this context.  

Thanks in advance for any guidance you have. 

@MargaretW,

You can do this:

$e{ round( ( gr://SC_emoKcRxLvqHeFTw/Score / 3 ) * 100 ) , 0 ) } 


Tom! thank you. For future knowledge, I am assuming the 0 before the closing parenthesis refers to the number of places after the decimal. Is that correct? Thanks again. 


Tom! thank you. For future knowledge, I am assuming the 0 before the closing parenthesis refers to the number of places after the decimal. Is that correct? Thanks again. 

Correct.


@TomG I attempted the method you shared, but I am receiving {Invalid Expression}. Would you mind looking at this and letting me know if you see anything wrong with it? Thank you!

 

$e{ round( ( WHODAS_mean ) , 2 ) }


@TomG I attempted the method you shared, but I am receiving {Invalid Expression}. Would you mind looking at this and letting me know if you see anything wrong with it? Thank you!

 

$e{ round( ( WHODAS_mean ) , 2 ) }

Is WHODAS_mean an embedded data field? Is so it would be:

$e{ round( e://Field/WHODAS_mean , 2 ) }


@TomG I attempted the method you shared, but I am receiving {Invalid Expression}. Would you mind looking at this and letting me know if you see anything wrong with it? Thank you!

 

$e{ round( ( WHODAS_mean ) , 2 ) }

Is WHODAS_mean an embedded data field? Is so it would be:

$e{ round( e://Field/WHODAS_mean , 2 ) }

 

@TomG Yes, it was an embedded data field. That fixed it!

 

Thank you so much for your prompt problem-solving! I really appreciate it.


Leave a Reply