Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Alarkis
New Contributor

Expression for this SQL query

Hello All,

I want to create this Query with expression:

select
sum( case when Total_Time <= :T Then 1 Else 0 End ) / Count(1) * 100 Perc_Acheived
From
(
SELECT application_no, SUM (work_time) total_time
FROM FN_WFLOG_MV
WHERE
(application_no, applicant_no) IN
(SELECT application_no, applicant_no
FROM FN_WFLOG_MV
WHERE WF_TASK_NAME = 'Task1'
AND TO_CHAR (ACTION_DATE, 'YYYYQ') = :Q
AND USERID IS NOT NULL
AND TO_WF_TASK_NAME = 'To_Task1'
AND ACTION_NAME = 'Action1')
AND TO_CHAR (ACTION_DATE, 'YYYYQ') = :Q
AND DEPT_NAME = 'DEPT1'
AND WF_TASK_NAME = 'TASK1'
GROUP BY application_no

T is a variable for Days

Q is for Year and Quarter

output is a percentage...

Labels (3)