See Community post: https://redcap.vumc.org/community/post.php?id=259667&comment=259668
I was working on a dynamic sql field, but ran into a snag where one of the data elements I wanted to include in the label was a dropdown. So, instead of piping the label of the field into the visible part of the dynamic sql, I put the numerical key.
As a challenge, I spent the next few hours trying to hack a sql solution for replacing the value with the label and got something that seems to work. The following is the story:
So, the intended sql label was to look something like this: