Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a small piece of code which basically checks if the question is 2 or 3 and
If the question is 3, it saves the corresponding answer as Final answer.
What I need is if the question is 2, it shows test for now but I would still like to save the Final answer as whatever was answer for question 3.
Is there a way I can achieve this? Any help will be appreciated
LOAD distinct
DataPoint,
if (Question=3,Answer,'test' ) as [Final Answer]
FROM
$(vQVDLocation)DataPointAnswerChoice.qvd
(qvd) where match(Question,2,3);
The pseudo code is something along below lines
if( question =3, answer, ( answer where question would have been 3) )
Tbl:
LOAD distinct
DataPoint,
if (Question=3,Answer,'test' ) as Answer3,
Question
FROM
$(vQVDLocation)DataPointAnswerChoice.qvd
(qvd) where match(Question,2,3);
Join(Tbl)
LOAD
DataPoint,
2 As Question,
Answer As Answer2
FROM
$(vQVDLocation)DataPointAnswerChoice.qvd
(qvd) where Question=3;
Final:
Load *, if (Question=3,Answer3,Answer2 ) as [Final Answer] Resident Tbl;
Drop Table Tbl;
Thank you so much anbu cheliyan. That fix worked like a charm.
Thanks for trying to help Robert, Anbu Cheliyan helped me solve it.