Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Writing Multiple IF Condition with Sum aggregate function

Hi All,

I Need help with below requirement.

Data:  

TeamProcessActualTotalStandard
MTVECOM4010050%
MTVDTCKT609050%
LOAMLOTICKT9016050%
LOAMLODRAFT12020050%


Requirement : Want to Create a text box to show number of teams that met standard (i need the output in team level).

Condition: If 2 process of a team meets Standard( Actual/Total>=50%) then Teamstd count will be 1, else if only 1 team meets standard(>=50%) then it will be Teamstd counted as 0.

Explanation : In the above table for TEAM="MTV" only 1 team [ DTCKT Actual/Total >=50]  where as in TEAM="LOAM" for 2 process  Actual/Total <=50%  so in the text box i want to show 1/2 (it says only 1 team out of 2 has 100% Success rate).

Please help.

Thanks in advance.

  1. Arjin.
1 Solution
4 Replies
Anil_Babu_Samineni

Perhaps you required from Script level

If(Team = 'MTV', (Sum({<Process = {'DTCKT'}>}Actual)/Sum(TOTAL Actual)) >= '50', (Sum({<TEAM = {'LOAM'}, Process = P::$Process>}Actual)/Sum(TOTAL Actual)) <= '50' )))

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
Anonymous
Not applicable
Author

Hi Sunny,

I am facing issue in context to above and request your kind help to look into it,

My actual data has 5 Teams where as only 2 teams has Process (MTV & LOAM)

TeamProcessActualTotal
MTVECOM40100
MTVDTCKT6090
LOAMLOTICKT90160
LOAMLODRAFT120200
LS
LD
RDM
DIDB

When i use the below expression i am getting the  result as 0 where as it should be 1, applying if(Team='MTV' or Team='LOAM',Team)  is skewing the result, Please help to fix this.


=Sum(Aggr(If(Sum(Aggr(If(Actual/Total >= 0.50, 1, 0), Process,if(Team='MTV' or Team='LOAM',Team))) = Count(Process), 1, 0), if(Team='MTV' or Team='LOAM',Team)))


Thanks in advance,

Arjin.

sunny_talwar

Would you be able to share a sample to look at the issue here?