Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
The Group1 shouldbe equal to Group2, as we need to follow the below logic to define the code. would you pleas help me to correct the code as I'm new to QlikView.
AAA = 'SECA ● SECB ● SECC’
AAA = 'SECB ● SECA ● SECC’
AAA = 'SECC ● SECB ● SECA’
AAA = ‘'SECC ● SECA ● SECB’
Group1 | Group2 |
AAA | 'SECA ● SECB ● SECC’ |
if(Group1)='AAA' and (Group2)='SECA ● SECB ● SECC' or (Group2)='SECA' and (Group2)='SECB' and (Group2)='SECC','Correct','Wrong' as Data,
Try this out:
Group:
Load *
Inline
[Group1, Group2,
AAA, SECA ● SECB ● SECC
AAA, SECB ● SECA ● SECC
AAA, SECC ● SECB ● SECA
AAA, SECC ● SECA ● SECB
AAA, SECA ● SECB ● SECC ● SECD
AAA, SECA ● SECB
];
Groupnew:
LOAD Group1,
Group2,
If(Group1 = 'AAA' and Index(Group2, 'SECA') and Index(Group2, 'SECB') and Index(Group2, 'SECC') and Len(Trim(KeepChar(Group2, '●'))) = 2, 'Correct', 'Wrong') as Data
Resident Group;
if(
(Group1='AAA' and Group2='SECA ● SECB ● SECC')
or (Group2='SECA' and Group2='SECB● SECC','Correct','Wrong') as Data,
Not entirely sure what you are doing, but you have some misplaced parenthesis:
If(Group1 = 'AAA' and Group2 = 'SECA ● SECB ● SECC' or (Group2 = 'SECA' and Group2 = 'SECB' and Group2 = 'SECC'), 'Correct', 'Wrong') as Data,
I am still not 100% sure if this is right, but may be if you can expand on the logic, we might be able to provide a better response
Thanks for your response.
But when I try to update the following logic doesn't match. Please refer logic screenshot + attached qvw which I created.
Try this out:
Group:
Load *
Inline
[Group1, Group2,
AAA, SECA ● SECB ● SECC
AAA, SECB ● SECA ● SECC
AAA, SECC ● SECB ● SECA
AAA, SECC ● SECA ● SECB
AAA, SECA ● SECB ● SECC ● SECD
AAA, SECA ● SECB
];
Groupnew:
LOAD Group1,
Group2,
If(Group1 = 'AAA' and Index(Group2, 'SECA') and Index(Group2, 'SECB') and Index(Group2, 'SECC') and Len(Trim(KeepChar(Group2, '●'))) = 2, 'Correct', 'Wrong') as Data
Resident Group;
Thanks Sunny, it works well