3 Replies Latest reply: May 9, 2017 10:20 AM by Jeff Clevenger

# Help with chart expression

I am looking for some advice on the following scenario:

Item, Pattern1, Pattern2, Pattern2Qty
A, 1, 1, 100
A, 1, 1, 150
A, 1, 2, 125
A, 1, 2, 200
A, 1, 2, 250
B, 2, 1, 50
B, 2, 1, 300
B, 2, 2, 150
B, 2, 2, 200
]
;

I am looking for the Max of Pattern2Qty (grouped by Item), where Pattern1 = Pattern2. The result should look like this..

A   150

B   200

Thank you for taking the time to help me....

• ###### Re: Help with chart expression

Straight table:

Dimension: item

Exp:  Max(If(Pattern1=Pattern2, Pattern2Qty))

• ###### Re: Help with chart expression

It seems that I am always over thinking it!  Thank you, this worked perfectly.

• ###### Re: Help with chart expression

Or may be create a flag in the script

If(Pattern1 = Pattern2, 1, 0) as Flag

Item, Pattern1, Pattern2, Pattern2Qty
A, 1, 1, 100
A, 1, 1, 150
A, 1, 2, 125
A, 1, 2, 200
A, 1, 2, 250
B, 2, 1, 50
B, 2, 1, 300
B, 2, 2, 150
B, 2, 2, 200
];

and then this

Max({<Flag = {1}>} Pattern2Qty)