first, second, third order flag ... for each customer
i have 3 series of data (Customer ID, Order ID and Timestamp- Order Time). i would like to add a new column with a numeric flag for each order and this flag to show if that order was the first one made for that specific customer or the second one or the third one etc.
You can use the autonumber function presented by @Arthur_Fong , but it will perform slowly on a large data set with many customers. The peek method described below will be a bit more complicated to write, but more effective to run.
If(peek('Customer') =Customer , peek('CustOrderSeq')+1, 1) as CustOrderSeq
Order by Customer, [Timestamp order];
Plees ekskuse my Swenglish and or Norweglish spelling misstakes
Andrei, did either Arthur's example or Vegar's post help you with a solution? If one or both of them helped, consider using the Accept as Solution button on the post(s) that did help. If you did something different, consider posting that and mark that post, and if you are still working on things, provide an update on where you stand.
Here is a Design Blog post that may provide another idea, it is not quite the same thing, date-based, but the concept is what I thought might help. I have a feeling Vegar's post is likely the most efficient way to do things in this use case...
To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question. I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.