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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

A serial number in straight table

Hello Experts,

I am showing top 20 clients in a straight table containing only two columns, client names and their repective sale. I want to show serial number in this straigh table that is starting from 1 to 20. I tried using Rowno() but I can only use it in expression so I cant bring Rowno() before the client name also as I said I want to show top 20 clients only so using rowno() I'm not getting the right top 20 clients as the table is sorted according to sales numbers.

Is there any way to add serial number in this straight table so that I can have 3 columns. Very first column will be SerialNo, then Client and and lastly the sales values.

Many thanks

Waqas

6 Replies
Miguel_Angel_Baeyens

Hello Waqas,

You cannot pivot a straight table, but you do can move the expressions and dimensions holding the click on the corresponding column until the blue arrow shows up, then move it to the first place. That should work.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Anonymous
Not applicable
Author

thanks Miguel for your reply. But using rowno() I'm losing my top 20 clients sorting order. how can I manage that?

Miguel_Angel_Baeyens

Hello Waqas,

It's working fine here. Can you please upload some sample data? Try NoOfRows() instead.

Regards.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

Not applicable
Author

Hello Waqas,

I had a similar problem but with more dimensions and expressions in one straigth table and was getting mad with the rowno() screwing up my desired sorting. Finally the rank() function was solving my issue. Just use rank(your aggregation expression), for turning around the ranking: rank(1/your aggregation function).

Best regards,

Mr.Rossi

Not applicable
Author

Hello Waqqas,

As an option that you can use, =FirstSortedValue(client, -sales) ,  if you do not know what this will do it will return the 'client' field data, based on the highest sales.  If you wanted to get the next one it would be =FirstSortedValue(client - 1, -sales).  If you were to put this into a loop based on the row of the table you are creating it could work.

Regards,
Jeff

miranrai
Contributor III
Contributor III

Hi, I am facing same problem. I have a straight table with 2 dimensions and 8 expressions with set analysis formula. I have added sort based on one of the expression but when i add Rowno(Total) it affect my sort order. I am sorting top 20 client based on revenue. Thank you..