Hi All-
I’ve been using calculated PRVs and program rules to calculate a score in one of my tracker programs. The general process I used was calculating an intermediate PRV as either 0 or 1 based on each condition that contributes to the score, then adding all the PRVs together to come up with a final score and assigning that final score to a DE. The expression that is assigned to the DE is something like this, where #{Xn} is a calculated PRV with value of 0 or 1.
This was working fine, and returning a value between 0 and 7. However, we recently upgraded to 2.35.7, and I realized that now the above expression is concatenating the PRVs. Its returning something like this:
0101100
I reviewed the release notes and can’t find anything related to this. Has anyone experienced something similar?
Thanks so sharing this info… so it seems like when the variable value is zero, it’s treated as a string, so what if we specify that it’s a number using ‘\d’?
so @kstankevitz expression will look like this: '\\d#{x1}' + '\\d#{x2}' + '\\d#{x3}' + '\\d#{x4} + '\\d#{x5} + '\\d#{x6} + '\\d#{x7}'
Thanks for this suggestion. I attempted this, but it doesn’t seem to be working. It returns false, value_not_positive_integer.
Based on troubleshooting others did to point out the 0s are the issue, i ultimately assigned the intermediate values and 1/2 instead of 0/1. Then I sum 7 PRVs and subtract 7 to get the true score. This works for now.
Hey! Sorry my suggestion didn’t work, I was just guessing!
That’s really great that you were able to find a workaround! Feel free to add it to the Jira issue! I look forward to your participation in the CoP, maybe you’ll find other workarounds for other users
Thanks so much for your solution, nice trick there!!
For several hours been trying to figure out how to overcome the concatenation (kept getting this: “value”:“value_not_numeric”).
@Gassim any plans to ensure this concatenation issue is resolved for the future- assigning 1/2 can be confusing, though works perfect? While the PRVs are correctly assigned integers (Yes -2, 1 - No), on summing up the PRVs, it does see the assignment as a string, especially if zero is the value assigned.
Thanks @mykbitz! I’m asking @zubair if there are any updates on this!
[quote=“mykbitz, post:9, topic:44548”]
While the PRVs are correctly assigned integers (Yes -2, 1 - No), on summing up the PRVs, it does see the assignment as a string, especially if zero is the value assigned.
[/quote] I’m not sure I got it right? Didn’t the approach above work? Would you please explain for me this part?