Embedded Data Question | XM Community
Skip to main content
Question

Embedded Data Question

  • September 19, 2024
  • 6 replies
  • 41 views

Forum|alt.badge.img+1

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?

6 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5911 replies
  • September 19, 2024

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}


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 5 replies
  • September 19, 2024

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


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5911 replies
  • September 19, 2024

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


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 5 replies
  • September 19, 2024

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


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 5 replies
  • September 19, 2024

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


Forum|alt.badge.img+1
  • Author
  • Level 1 ●
  • 5 replies
  • September 19, 2024

qA