Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rammuthiah
Creator III
Creator III

Score based on logic

Hi

Problem listed below. I need the score to be False for A if anyone in A is False. But for B, if any false in B and if any false in A, then false, if all are True in A and any of B is false, then B should be true.

C

C1

C2

Check

Score

A

100

100

TRUE

FALSE

A

200

200

TRUE

A

300

250

FALSE

B

300

300

TRUE

FALSE

B

250

250

TRUE

B

600

600

TRUE

Score for A

if any false in A, then False

Score for B

if any false in B and if all A is true, then True, Otherwise False

13 Replies
Mark_Little
Luminary
Luminary

If so,

DATA:

Load * Inline [

C, C1, C2, Check,

A, 100, 100, TRUE

A, 200, 200, TRUE

A, 300, 300, TRUE

B, 300, 300, TRUE

B, 250, 250, TRUE

B, 600, 500, FALSE];

NoConcatenate

NewTable:

LOAD

1 As Group,

C,

    C1,

    C2,

    Check,

    IF(ROWNO()=1,

    IF(Check = 'FALSE',

    1,

            0

           ),

        PEEK(FalseCount,-1) + IF(Check = 'FALSE',1,0)

      ) AS FalseCount     

Resident DATA

ORDER by C desc;

DROP Table DATA;

LEFT JOIN

LOAD

Group,

    IF(SUM(FalseCount) > 0, 'FALSE','TRUE') AS SCORE

Resident NewTable

GROUP BY Group;

We add a new column to group our complete combined table.

Mark

rammuthiah
Creator III
Creator III
Author

Your logic is correct. But here I am fetching value for A and B from 2 tables. And using check 1 for A and Check 2 for B to perform the logic.

Supplier/Customer

C1

C2

Check 1

Check 2

Check(if isnull(Check1),Check 2,Check 1))

A

100

100

TRUE

TRUE

A

200

200

TRUE

TRUE

A

300

250

FALSE

FALSE

B

300

300

TRUE

TRUE

B

250

250

TRUE

TRUE

B

600

600

TRUE

TRUE

So, I am confusing how to perform the logic in front end expression

rammuthiah
Creator III
Creator III
Author

I have done upto Check, but while tried for FalseCount, the row count is getting increased based on your logic.

Score card based on logic

Can you lookup the requirement?

rammuthiah
Creator III
Creator III
Author

Hello Mark,

Is there any way to do the logic mentioned in the given link? Logic to Find Value for Score1 and Score 2