Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
arjinram
New Contributor II

Writing Multiple IF Conditions

Hi All,

I Need help in using multiple if conditions for the below requirement.

Source data:

  

TEAMPROCESS% Process
MLTVLast Submit to First TV Checked39%
MLTVLast Submit to First TV Action92%
LOAMFinal Approval to First Response97%
LOAMFinal Approval to LO Gen80%

Requirement 1:

To Count Number of process in each teams & No of process that has more than 50% value. i achieved this using below expression

Output1: 

TeamMet Target
MLTV  1/2
LOAM  2/2

Script1:

= if(GetSelectedCount(TEAM)=0,

sum(Aggr(

IF(count(DISTINCT{$<[END DT]={"*"},%ProcessingType={'End'},PROCESS={'*'}-{'First TV Pickup to First TV Checked By TVO'}, [SLA BUCKET]={'1'}>} [CASE_NUM]) /

   count(DISTINCT{$<[END DT]={"*"},%ProcessingType={'End'},PROCESS={'*'}-{'First TV Pickup to First TV Checked By TVO'}>} [CASE_NUM])>=0.5,1,0),PROCESS))

   & '/' & count( DISTINCT (IF(PROCESS<>'First TV Pickup to First TV Checked By TVO',PROCESS))))

,0))

 

Requirement 2:

To get the number of teams that has met 100% target in a text box

Output2 Needed:


   1/2

out of 2 teams only  LOAM Team has met 100% Target(2/2). so output should be 1/2.


Script2:

i used below script but my condition is applying condition on process level, below script is giving output as 0,because condition is applied at process level, since not all  process met target its resulting 0.



=if(GetSelectedCount(TEAM)=0,

IF(sum(Aggr(

IF(count(DISTINCT{$<[END DT]={"*"},%ProcessingType={'End'},PROCESS={'*'}-{'First TV Pickup to First TV Checked By TVO'}, [SLA BUCKET]={'1'}>} [CASE_NUM]) /

   count(DISTINCT{$<[END DT]={"*"},%ProcessingType={'End'},PROCESS={'*'}-{'First TV Pickup to First TV Checked By TVO'}>} [CASE_NUM])>=0.5,1,0),PROCESS))=

   count( DISTINCT (IF(PROCESS<>'First TV Pickup to First TV Checked By TVO',PROCESS))),1,0))

Please Help with a solution.

Thanks In Advance.

Arjin.

2 Replies
el_aprendiz111
Valued Contributor

Re: Writing Multiple IF Conditions

hi,

one solution from in script,, 1 example

IFCON.png

effinty2112
Honored Contributor

Re: Writing Multiple IF Conditions

Hi Arjin,

                    Try the expression in this table to get your first output

TEAM count({$<[% Process] = {">0.5"}>}PROCESS) & ' / ' & count(PROCESS)
MLTV1 / 2
LOAM2 / 2

A textbox with this expression:

=Sum(Aggr(if((count(DISTINCT {$<[% Process] = {">0.5"}>}PROCESS) / count(PROCESS))=1,1), TEAM)) &  ' / ' & Count(Distinct TEAM)

will return

1 / 2

Kind regards

Andrew

Community Browser