0

Hi Everybody and thanks in advance to whom will answer my question: I think I need a for loop in tableau and looking for a working around;

my table has the following structure

id, id_detail, result
1      1        fail
1      2        pass
1      3        pass
2      1        pass
2      2        pass
3      1        fail
3      2        pass
...
...

I need to assign to id=1 fail; id=2 pass; id=3 fail

img

do You have any suggestions?

AnilGoyal
  • 25,297
  • 4
  • 27
  • 45
CCC
  • 3
  • 2
  • 1
    could you please provide more context about the "logic" behind your need? Tableau doesn't have loops but maybe we can find a solution if you had more details. – Fabio Fantoni Jul 16 '21 at 07:26
  • I need to have the following logic at the product level: "if the product has at least one test with evaluation=fail then I want to record fail; pass result should be given to product only if all test evaluation are = pass; Needed result for the following example is Product ID=1 Evaluation = Fail; Product ID=2 Evaluation = Pass; Product ID=3 Evaluation = Fail: Product ID Test ID Test Evaluation 1 1 pass 1 2 pass 1 3 fail 2 1 pass 2 2 pass 3 1 pass 3 2 pass 3 3 pass 3 4 fail – CCC Jul 17 '21 at 10:48
  • that's what is like providing context for a better question in order to get better answer... let this method be your approach for the nex questions ^_^ – Fabio Fantoni Jul 19 '21 at 10:04

1 Answers1

0

You may use the alphabetic order where pass is greater than fail

create this calculated field

{FIXED [Product ID]: MIN([Test Evaluation])}

and you'll get what you want

enter image description here

AnilGoyal
  • 25,297
  • 4
  • 27
  • 45