i would first creat a mapping table with customer and max(value) grouped by customer.
In the load of the table I would then use applymap function to lookup the max value. If the max value is equal to the value field I would set a flag.
it could be like this:
group by customer
If(applymap('MAPmax',customer)=value,1) as FlagMax
A mapping load is used to create a mapping table.
A mapping table is a table of always 2 fields and the table only exists during the reload procedure. It is used when you want to lookup a value.
It's used a lot when you load a fact table and want to lookup a surgate dimension key from a dimension table. In this case you create a mapping table with the unique business key and the corresponding surrogate key.
Mapping load is faster than the lookup function, but the lookup function is more flexible.
You should take a look in the help area, and search for mapping load and lookup. I believe there are some examples.
Try this script below
LOAD * INLINE [
Customer, Article, Line, Value
A , 1, 1 , 100
A, 1 , 2 , 200
A, 1 , 3 , 80
B , 2 , 1, 40
B, 2 , 2, 30
B , 2 , 3 , 10
C, 1 , 1, 20
C , 1 , 2 , 100
IF(Previous(Customer) <> Customer, '*') AS Flag
ORDER BY Customer, Value Desc;
DROP TABLE Temp;
Hope this helps you.