Here's my requirement
Should be done in script.
Product, Value, RowNo
Basically for each value of Product, the rowno() should reset and start from 1.
Currently trying with Peek. Let me know if you guys can solve it more quickly.
I think Peek is needed in script -
Load * inline [
if(Product=Previous(Product),Rangesum(Peek(Row_No),1),1) as Row_No
Drop table Source
AutoNumber(RecNo(), Product) as Counter
Excellent solution. I did this using 2 for next loops. Your solution is the best one liner ever rwunderlich
It's a good technique using AutoNumber. Note that it can be slow if there are many thousands of different Product values, in which case you revert to the previous/peek method.
Just a quick clarification,
Here the product field is acting like the Auto ID right?
I would be happy if you could also explain what Auto ID does?
Yes, Product is acting as the AutoId. AutoId establishes a separate counting sequence for each value of the AutoId.
Retrieving data ...