Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I would like to list products that first time exist only. Week will be my selection, so i can know what is the new product sold on particular week.
Any idea how to do it in set analysis??
@dleelearn I am not sure if we can do it directly in Set analysis. So I made small change in the script before we go on to Set Analysis. Please see the script below used in the back end first:
NoConcatenate
Temp:
Load
Recno() as RecordNumber,
Product,
Week,
Sold,
if(Previous(Product)=Product and Previous(Week)<>Week,'Already Purchased','New Purchase') as Flag
Inline [
Product, Week, Sold
A,1,1
A,2,1
B,1,2
B,1,2
C,2,3
C,2,3
D,2,4
E,1,4
F,2,5
];
Exit Script;
In the frond end the expression would be: Sum({<Flag={'New Purchase'}>}Sold)
If this resolves your issue, please like and accept it as a solution.
@dleelearn I am not sure if we can do it directly in Set analysis. So I made small change in the script before we go on to Set Analysis. Please see the script below used in the back end first:
NoConcatenate
Temp:
Load
Recno() as RecordNumber,
Product,
Week,
Sold,
if(Previous(Product)=Product and Previous(Week)<>Week,'Already Purchased','New Purchase') as Flag
Inline [
Product, Week, Sold
A,1,1
A,2,1
B,1,2
B,1,2
C,2,3
C,2,3
D,2,4
E,1,4
F,2,5
];
Exit Script;
In the frond end the expression would be: Sum({<Flag={'New Purchase'}>}Sold)
If this resolves your issue, please like and accept it as a solution.