Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Alarkis
Contributor III
Contributor III

Script to set analysis

hello how can i create something like this with set analysis

 

select count(1), avg(Total_Time) avergae,
    sum( case when Total_Time <= :T Then 1 Else 0 End ) Achieved,
    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 = 'Approval'
                         AND TO_CHAR (ACTION_DATE, 'YYYYQ') = :Q
                         AND USERID IS NOT NULL
                         AND TO_WF_TASK_NAME = 'Task'
                         AND ACTION_NAME = 'ppp')
        AND TO_CHAR (ACTION_DATE, 'YYYYQ') = :Q
        AND DEPT_NAME = 'ttt'
        AND WF_TASK_NAME = 'Approval'
GROUP BY application_no
)
Labels (2)
1 Reply
Anil_Babu_Samineni

@Alarkis  Hello, This page is so calm from long time. Would you like to come back and check this. Please access your answer after you palced the resolution or workaround on this?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful