Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I have a table where I have let say 3 columns. Product_Name, Test_Result, Error_Code. Example:
| Product_Name | Test_result | Error_Code |
| P1 | PASS | |
| P2 | PASS | |
| P3 | PASS | |
| P4 | FAIL | 1 |
| P5 | FAIL | 1 |
| P6 | FAIL | 2 |
| P7 | FAIL | 3 |
| P8 | FAIL | 2 |
| P9 | FAIL | 3 |
| P10 | FAIL | 1 |
I need to create a table chart where dimension in Test_Result and measure is count of test_result.
The issue is:
requirement is that when user select any error code let say error code = 2, all the other error code should be considered as pass. so in case when error code 2 is selected, Fail count is 2 and pass count is 8
for me 'fail' dimension is fine. But for dimension value 'Pass', i am unable to produce 8. could you please help me to acheive this.
Load script for the above dummy data is:
LOAD * Inline [
Product_Name , Test_result , Error_Code
P1, PASS,
P2, PASS,
P3, PASS,
P4, FAIL, 1
P5, FAIL, 1
P6, FAIL, 2
P7, FAIL, 3
P8, FAIL, 2
P9, FAIL, 3
P10, FAIL, 1
];
At first I would try to create a view for the wanted information without the dimension "Test_result" by using two expressions, like:
count({< Error_Code = p(Error_Code)>} Test_result)
count({< Error_Code = e(Error_Code)>} Test_result)
If this isn't feasible a next step may go to create a calculated dimension, like:
valuelist('PASS', 'FAIL')
and then assigning the above shown expressions to the values, for example:
pick(match(valuelist('PASS', 'FAIL'), 'PASS', 'FAIL'),
count({< Error_Code = e(Error_Code)>} Test_result),
count({< Error_Code = p(Error_Code)>} Test_result))
Hi @musketeers
Try a table with the following dimension and measure:
Dimension:
If(GetSelectedCount(Error_Code)<>1, Test_result, if(Error_Code=GetFieldSelections(Error_Code),'FAIL','PASS'))
Measure:
Count({<Error_Code= >}Test_result)
It seems to work for me:
Kind Regards
Daniel