It's all about the answers!

Ask a question

IBM Report Builder issue with enumeration list in DNG and LISTAGG


Krzysztof Koprowski (1017) | asked May 11 '20, 12:42 p.m.
Hi

I have issue with LISTAGG function in Report Builder when generating reports from DNG.

Requirements has enum list that can have values from 1 to 10, so one requirement can have for example 1,5 and 6.

When we will execute report with LISTAGG using this attribute we are getting 1,1,1,5,5,5,6,6,6.

Each selected value is displayed 3 times.

Can You help us to make each value to appear once like it should be 1,5,6.

Accepted answer


permanent link
Bartosz Chrabski (3.4k22949) | answered May 11 '20, 12:47 p.m.
edited May 11 '20, 12:48 p.m.

 Hi Krzysztof,


If you want to get rid of duplicates, you should use distinct function other with listagg. I do not know what database are you using but for DB2 it should look like "LISTAGG(DISTINCT T4.LITERAL_NAME,',') AS LITERAL_NAME".

Additionally, if this query wont validate because it will be too complex for Report Builder to validate then You can turn off the validation.

/validate_off{/ (LISTAGG(DISTINCT T4.LITERAL_NAME,',') AS LITERAL_NAME /}/

Krzysztof Koprowski selected this answer as the correct answer

Your answer


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.