Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
pepe2209
Creator
Creator

Row count on only first dimension of a two dimension table

Hello this is what i would like to achieve, i have a table with 2 dimensions like this:

Dimension1= CompanyDimension2= Period (weeks)RowNo()RowNo(total)I want: RowNo(only first dimension)
A1-4111
A5-8221
A9-12331
B1-4142
B5-8252
B9-12362
C5-8173
C9-12283
D1-4194
D5-82104

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

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try aggr(NODISTINCT RowNo(),Company)


talk is cheap, supply exceeds demand
pepe2209
Creator
Creator
Author

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.

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

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.


talk is cheap, supply exceeds demand
pepe2209
Creator
Creator
Author

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.