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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rajanr88
Contributor
Contributor

Compare data within same dimension

I have the following table data.

 

Scenario.    Test case.         Status 

A.                         1.                        Pass 

A                          1.                         Pass 

 A                       1.                         Fail

B.                    1.                         Pass

B.                  1.                          Pass

I need to get another column named ' Overall status's for the scenario, whose value should be based on below logic:-

 

If all test case status are Passed , overall status is Pass

If atleast one of the testcase status is failed, overall status is Failed.

 

Can someone help me how to achieve this.

Labels (1)
1 Solution

Accepted Solutions
avinashelite

hmm you should give the completed data sample , never mind .. try like this 

Test:
LOAD * Inline
[
Scenario,Test case,Status
A,1,Pass
A,1,Pass
A,1,Fail
A,1,Blocked
B,1,Pass
B,1,Pass
];

Join(Test)
LOAD Status,
Dual(Status,Status_value) as Status_Derived;
LOAD * Inline
[
Status,Status_value
Pass,3
Fail,1
Blocked,2
];

Left Join(Test)
LOAD
Scenario,
"Test case",
if(min(Status_Derived)=3,'Pass','Fail') as Overall_Status_Num
Resident
Test
Group by
Scenario,
"Test case";

avinashelite_0-1602069426178.png

 

View solution in original post

3 Replies
avinashelite

Find the solution below

Test:
LOAD * Inline
[
Scenario,Test case,Status
A,1,Pass
A,1,Pass
A,1,Fail
B,1,Pass
B,1,Pass
];

Left Join(Test)
LOAD
Scenario,
"Test case",
MinString(Status) as Overall_Status
Resident
Test
Group by
Scenario,
"Test case";

 

Output:

avinashelite_0-1602047875839.png

 

rajanr88
Contributor
Contributor
Author

Hi,

It works fine for status as Pass , Fail.

But if I have a combination of Blocked , Fail, Pass I expect to get overall status as Fail, but using the above solution , I would get the overall status as Blocked.

avinashelite

hmm you should give the completed data sample , never mind .. try like this 

Test:
LOAD * Inline
[
Scenario,Test case,Status
A,1,Pass
A,1,Pass
A,1,Fail
A,1,Blocked
B,1,Pass
B,1,Pass
];

Join(Test)
LOAD Status,
Dual(Status,Status_value) as Status_Derived;
LOAD * Inline
[
Status,Status_value
Pass,3
Fail,1
Blocked,2
];

Left Join(Test)
LOAD
Scenario,
"Test case",
if(min(Status_Derived)=3,'Pass','Fail') as Overall_Status_Num
Resident
Test
Group by
Scenario,
"Test case";

avinashelite_0-1602069426178.png