Question
How to use LISTAGG function in Report Definition?
Hi all,
I've worte following user function:
Add it to my Report Definition:
Now that RD generate following SQL code:
SELECT LISTAGG("PC0".TEAMMEMBERNAME, ',') WITHIN GROUP (ORDER BY "PC0".TEAMMEMBERNAME) AS "pyTextValue(1)", "PC0".CASEID FROM PRPC.MYORDERS_TEAMMEMBERS "PC0";
And it executes with error:
ORA-00937: not a single-group group function
Yes, this right, this function will not work without group by statement at the end of sql query:
SELECT LISTAGG("PC0".TEAMMEMBERNAME, ',') WITHIN GROUP (ORDER BY "PC0".TEAMMEMBERNAME) AS "pyTextValue(1)", "PC0".CASEID FROM PRPC.MYORDERS_TEAMMEMBERS "PC0" GROUP BY CASEID;
Question: how to add this "GROUP BY CASEID" in Report Defenition?
Hi Dmitry,
Normally, to do a "group by" we add a Summarized column such as COUNT pyID.
The content (input parameters, presentation and source) of the user function is not clear for me to recreate a similar function at my end.
Could you please upload / attach a better resolution of the first screenshot?
Thanks,
Gisela