javascriptpentaho

Pentaho check if at least one row LDAP is 0


I have multiple rows in Pentaho with Column name "LDAP flag"

Column user id LDAP flag
Row 1 A 1
Row 2 B 1
Row 3 B 0

I need rows like below:

Column user id LDAP flag
Row 1 A 1
Row 3 B 0

If at least one row is 0 then I need to set "LDAP check" to True

Column user id LDAP flag
Row 1 C 1
Row 2 C 1
Row 3 C 1

If all rows equal 1 then I need to set "LDAP check" to False


Solution

  • As always in PDI, you can do this in various ways. This is just one of the ways to accomplished this.

    You can use the Group by step:

    Transformation schema

    This is the configuration of the Group by step: Configuration of the Group by step

    And this of the Formula step: Configuration of the Formula step