Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
arethaking
Creator II
Creator II

Lable logic is not working

Hi All,

My Lable logic is not working in Pivot Table.

This is the condition.

=if(Flag='A' and [OrgName]='RX' and [Org Customer]='Yes',
'Score',
if(Flag='B' and [OrgName]='RX' and [Org Customer]='Yes',
'Score',
if(Flag='C' and [OrgName]='RX' and [Org Customer]='Yes',
'Score',
if(Flag='D' and [OrgName]='RX' and [Org Customer]='Yes',
'Rank'
))))

Expected Output:

Capture.PNG

Present output:

Capture1.PNG

My Source Data

Data:
LOAD * INLINE [
Org Customer,CustName,Flag,OrgName,Ascore,Bscore,Cscore,Dscore
Yes,Cust1,B,A1,Good,Good,Good,1st
Yes,Cust1,B,A2,Average,Average,Average,2nd
Yes,Cust2,B,A1,Outstanding,Outstanding,Outstanding,1st
Yes,Cust2,B,A2,Average,Average,Average,2nd
Yes,Cust1,B,RX,Average,Average,Average,1st
Yes,Cust1,A,A1,Good,Good,Good,2nd
Yes,Cust1,A,A2,Average,Average,Average,Not Ranked
Yes,Cust1,A,A3,Good,Good,Good,1st
Yes,Cust2,A,A1,Good,Good,Good,Not Ranked
Yes,Cust2,A,A2,Average,Average,Average,1st
Yes,Cust2,A,A3,Outstanding,Outstanding,Outstanding,Not Ranked
Yes,Cust1,A,RX,Average,Average,Average,1st
Yes,Cust1,A,RX,Average,Average,Average,Not Ranked
Yes,Cust2,C,,Good,Good,Good,1st
Yes,Cust1,C,RX,Average,Average,Average,1st
Yes,Cust1,D,A14,Good,Good,Good,1st
Yes,Cust1,D,A15,Good,Good,Good,2nd
Yes,Cust1,D,A1,Average,Average,Average,1st
Yes,Cust1,D,A2,Outstanding,Outstanding,Outstanding,2nd
Yes,Cust1,D,A3,Average,Average,Average,1st
Yes,Cust1,D,RX,Average,Outstanding,Outstanding,2nd
]
;

1 Solution

Accepted Solutions
qlikviewwizard
Master II
Master II

Hi,

Try like this.

2.JPG

1.JPG

View solution in original post

10 Replies
olivierrobin
Specialist III
Specialist III

hello

I think there's a problem with the logic of the test

you are grouping by Flag value

but for ONE value of Flag, you can have multiple values of OrgName

(example : select Cust1, Flag=A -> 4 Orgname : A2 , RX, A1, A3)

what is the expected output in this case ?

arethaking
Creator II
Creator II
Author

select Cust1, Flag=A -> 4 Orgname : A2 , RX, A1, A3 : Expected out is Score. I am taking only RX values

olivierrobin
Specialist III
Specialist III

in the expression value, yes

but not in the label value

vinieme12
Champion III
Champion III

=AGGR(if(Wildmatch(Flag,'A','B','C'), 'Score',if(Wildmatch(Flag,'C'),'Rank')),Flag)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
arethaking
Creator II
Creator II
Author

Hi vineeth pujari

Still for Flag D is showing Score instead of Rank.

Capture.PNG

arethaking
Creator II
Creator II
Author

Please use this data:

Data:
LOAD * INLINE [
Org Customer,CustName,Flag,OrgName,Ascore,Bscore,Cscore,Dscore
Yes,Cust1,B,A1,Good,Good,Good,1st
Yes,Cust1,B,A2,Average,Average,Average,2nd
Yes,Cust2,B,A1,Outstanding,Outstanding,Outstanding,1st
Yes,Cust2,B,A2,Average,Average,Average,2nd
Yes,Cust1,B,RX,Average,Average,Average,1st
Yes,Cust1,A,A1,Good,Good,Good,2nd
Yes,Cust1,A,A2,Average,Average,Average,Not Ranked
Yes,Cust1,A,A3,Good,Good,Good,1st
Yes,Cust2,A,A1,Good,Good,Good,Not Ranked
Yes,Cust2,D,RX,Average,Average,Average,1st
Yes,Cust2,A,A3,Outstanding,Outstanding,Outstanding,Not Ranked
Yes,Cust1,A,RX,Average,Average,Average,1st
Yes,Cust1,A,RX,Average,Average,Average,Not Ranked
Yes,Cust2,C,,Good,Good,Good,1st
Yes,Cust1,C,RX,Average,Average,Average,1st
Yes,Cust1,D,A14,Good,Good,Good,1st
Yes,Cust1,D,A15,Good,Good,Good,2nd
Yes,Cust1,D,A1,Average,Average,Average,1st
Yes,Cust1,D,A2,Outstanding,Outstanding,Outstanding,2nd
Yes,Cust1,D,A3,Average,Average,Average,1st
Yes,Cust1,D,RX,Average,Outstanding,Outstanding,2nd

]
;

vinieme12
Champion III
Champion III

A typo, the second condition should be for D

Not in front of my PC so cannot check your app


=AGGR(if(Wildmatch(Flag,'A','B','C'), 'Score',if(Wildmatch(Flag,'D'),'Rank')),Flag)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
arethaking
Creator II
Creator II
Author

Hi Vineeth, Thank you for the reply.

But it is not working.

Capture.PNG

qlikviewwizard
Master II
Master II

Hi,

Try like this.

2.JPG

1.JPG