GROUPROWNUMBER
Hi,
I have a problem with function GROUPBROWNUMBER(). I think it's a bug, hope you can help.
We use Personal Edition and Version 3.0.17 of Datameer.
My sheet contains 2 columns: ID and Date. Here's my base sheet: http://cl.ly/image/3z3N46070C14 (The two columns in the middle can be ignored.)
I want to use GROUPBROWNUMBER() to number the rows sorted by date. I sorted the sheet by date, so that earliest date is on top. Than I created a new sheet with these columns: GROUPBY on ID, GROUPBROWNUMBER() and COPY of date. The result is: http://cl.ly/image/1d083M3x3E0p
As you see the rows are numbered ascending, but the date in the second row is earlier than the date in the first row. As the base sheet is sorted by date, I don't understand why the new sheet is not sorted by date.
When I sort the new sheet by date, the earliest date is on top, but it has still number two in the column of GROUPBROWNUMBER(). I also tried to change order of columns of the new sheet into: ID, DATE, ROW NUMBER. Doesn't work, too.
Is this a bug of function GROUPBROWNUMBER() or am I doing something wrong?
-
Official comment
Thanks for the question!
The GROUPROWNUMBER function itself does seem to be working properly as you have described. However, your description highlights an assumption about the sort order after a grouping function.
In this example, I note that the first sheet is sorted by the Date column and then this data is grouped in a new sheet downstream. On the grouped sheet, you observe that the sort order has been disrupted from the source sheet. This is expected. Grouping functions do not automatically preserve the sort order of the original data.
To ensure that the grouping functions sort the data to meet your needs, I'd recommend utilizing the GROUP_SORT_ASC or GROUP_SORT_DESC function with your grouped results.
Specifically for this example, I'd recommend replacing the COPY(Date) function with GROUP_SORT_ASC(Date) to ensure that you grouped results are sorted by the Date column.
I hope this helps!
Comment actions
Please sign in to leave a comment.
Comments
1 comment