์ฃผ ์ฝ˜ํ…์ธ ๋กœ ๊ฑด๋„ˆ๋›ฐ๊ธฐ
27

Nested IF or CASE in stat builder Collecting Feedback

I would like to be able to  use CASE in the SELECT statement for DPQL.


I want the channel to display differently, i.e. instead of gateway.person, it will display as "user email" instead.


Example:


SELECT DPQL_COUNT(),
CASE
WHEN tickets.creation_system = 'gateway.agent' THEN 'agent email'
WHEN tickets.creation_system = 'gateway.person' THEN 'user email'
WHEN tickets.creation_system = 'web.agent.portal' THEN 'agent interface'
WHEN tickets.creation_system = 'web.person.portal' THEN 'user via portal'
ELSE 'Others'
END AS 'Channel'
FROM tickets
WHERE tickets.date_created = ${date}
GROUP BY tickets.creation_system



๋Œ“๊ธ€ ๋“ฑ๋ก

๋Œ“๊ธ€์„ ์ž‘์„ฑํ•˜๋ ค๋ฉด ๋กœ๊ทธ์ธํ•˜๊ฑฐ๋‚˜ ๋“ฑ๋กํ•˜์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค.

๋น„๋ฐ€๋ฒˆํ˜ธ๋ฅผ ์žŠ์œผ์…จ๋‚˜์š”?