It's all about the answers!

Ask a question

Can I program a Case function to not end when it encounters the first successful When statement?


Torin Denniston (15811) | asked Sep 28 '16, 12:34 p.m.
 Hello,

Using Cognos Connection with CLM 6.0.1, I am attempting to build a query that starts with an empty String [Cell String] and as it encounters certain values within another data item [Issue List Number] it will add values to [Cell String], resulting in a String that can be used in a table. I have included the code below for reference:

case [Issue List Number]
when 1 then [Cell String]+'1,'
when 2 then [Cell String]+'2,'
when 3 then [Cell String]+'3,'
when 4 then [Cell String]+'4,'
when 5 then [Cell String]+'5'
end

Currently the query returns 5 rows, with an Issue List Number for each (1, 2, 3, 4, 5). I am hoping for this query to look at the Issue List Number in each row, and as it potentially encounters each number, add values to the string. So [Cell String] may end up with value '1, 2, 3,' or '1,' or '' depending on what is encountered.

Any help is appreciated, whether that be guidance on how to adjust my Case function or guidance toward using a different function to accomplish the goal described above.

Thank you in advance!

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.