Embedded Data Question | XM Community
Skip to main content

Ok so I have three questions all with the same answers: 

I want to convert the max answer to a percentile, only focusing on the highest answer of those three. Right now I have this: 

So that works correctly. However, then I want to set a new embedded variable equal to the max value of those three. So I did this, but it doesnt work: 

Does anyone have any ideas for this -- essentially embedding a new variable that depends on the maximum of the other three?

You can do this:

maxlifpresc = ${e://Field/rxplifanswer}

if rxsifanswer Is Greater Than maxlifpresc

    maxlifpresc = ${e://Field/rxslifanswer}

if rxtifanswer Is Greater Than maxlifpresc

    maxlifpresc = ${e://Field/rxtlifanswer}

 

Also, you can simplify your survey flow by doing this instead of all the branches (change question ids accordingly):

rxplifanswer = ${q://QID1/SelectedChoicesRecode}

rxslifanswer = ${q://QID2/SelectedChoicesRecode}

rxtlifanswer = ${q://QID3/SelectedChoicesRecode}


Thank you so much! The only thing is when I do that maxlifpresc is always the value of rxplifanswer even when rxplifanswer is the smallest


I think I left out the ‘l’ (lowercase l) in embedded data fields in the branch conditions. That may be the problem.


Thank you so so much. Where is the l you left out?


Oh wait I see -- I had fixed that and still it hasn't worked.


qA


Leave a Reply