Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello this is what i would like to achieve, i have a table with 2 dimensions like this:
| Dimension1= Company | Dimension2= Period (weeks) | RowNo() | RowNo(total) | I want: RowNo(only first dimension) |
|---|---|---|---|---|
| A | 1-4 | 1 | 1 | 1 |
| A | 5-8 | 2 | 2 | 1 |
| A | 9-12 | 3 | 3 | 1 |
| B | 1-4 | 1 | 4 | 2 |
| B | 5-8 | 2 | 5 | 2 |
| B | 9-12 | 3 | 6 | 2 |
| C | 5-8 | 1 | 7 | 3 |
| C | 9-12 | 2 | 8 | 3 |
| D | 1-4 | 1 | 9 | 4 |
| D | 5-8 | 2 | 10 | 4 |
It shows how the normal RowNo() and RowNo(total) react, but it is not what i want.
Keep in mind that the second dimension is not a simple field that you can ignor, but an expression as such:
=if(isoweek>=weekname(today(),-4), '1-4', if(isoweek>=weekname(today(),-8), '5-8', if(isoweek>=weekname(today(),-12), '9-12')))
And this dimension does not always include all three possible periods, when there is no data in a certain period.
is it possible to get a row count on only the first dimension?
regards,
Peter
Selecting within company is not a problem. The count will still start with 1 if the sort order is the same as the load order of the dimension values. Sorting on another field will always mess up the order since the company values won't be grouped together anymore. That leaves the sort order / load order of the company values. I have no solution for that. If you make sure you load the company values in ascending order (for example by loading only company values first in a table (that you can drop later) so the symbol table for that field is populated in ascending order) you will make sure that the sort options Text Ascending and Load Order give the same result and incremental group numbering. That will leave Text Descending with descending group numbering too. At least the logic of that is understandable to end users and they won't see a random order that has no meaning at all.
Try aggr(NODISTINCT RowNo(),Company)
Thanks for your reaction. The problem of your method is that this count-number is linked to the order in which the data is loaded in the script. So if i sort the table differently or make a selection within "company" it's no longer an actual count starting from 1 to x.
Selecting within company is not a problem. The count will still start with 1 if the sort order is the same as the load order of the dimension values. Sorting on another field will always mess up the order since the company values won't be grouped together anymore. That leaves the sort order / load order of the company values. I have no solution for that. If you make sure you load the company values in ascending order (for example by loading only company values first in a table (that you can drop later) so the symbol table for that field is populated in ascending order) you will make sure that the sort options Text Ascending and Load Order give the same result and incremental group numbering. That will leave Text Descending with descending group numbering too. At least the logic of that is understandable to end users and they won't see a random order that has no meaning at all.
Ok I understand, this indeed should be enough for me to achieve a coherent count I can work with.
Thanks you've been a great help for not only this but more of my questions on this community.