Hi everybody,
I’m sure this is something that has a simple solution, but I’m not able to see it.
I need to add to the baq a column that displays the number on the line. Something like this
1 Part1
2 Part2
3 Part3
and so on
Could anybody give me a hand?
Sorry to bother with something I’m sure is pretty simple to achieve, but I can’t see it, I’m stucked
There is something called windowing functions which has a function that can do that.
In a calculated field, you’ll type in this code.
Row_Number() over (partition by table.field order by table.field)
The partition by is what you want to split it up by. So if you had say orders by customer, you could add the customer field in the partition by, and order by the date. Then whenever you hit a new customer in the data, the row numbers would start over. If you want everything to be in the same set, you just need to pick a field that they all have in common. Like company.
So in the case of a part number it would be the part number field, then you have to give it what you want to order it by.
Row_Number() over partition by(Part.Company order by Part.PartNumber)