주 콘텐츠로 건너뛰기

Nested IF or CASE in stat builder - 피드백 / Feature Request - Deskpro Support

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



댓글 등록

댓글을 작성하려면 로그인하거나 등록하셔야 합니다.

비밀번호를 잊으셨나요?