Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi!
We would like to add a column that simply shows "1" for the first row, "2" for the 2nd row and so on.
It should always show the same numbering even when the sorting is changed.
Thanks for your help!
Best Regards
Sebastian
Would you mind sharing a qvw?
I´ve done a small test, seems to sort ok. Maybe I´m not understanding your point of view
Thank you all for the overwhelming support. I did not expect such a lively community!
Attached two files showing the problem (xls and qvw).
As you can see the table cannot be sorted by "AVG(rate_overall)".
If you remove the column "RowNo(TOTAL)" it works fine.
Putting RecNo or RowNo into the script did not seem to work either, due to the aggregate function used in the table.
My Task is to sort the table by "AVG(rate_overall)" or other columns and show one column containing the row number.
I would like to make a ranking of location ratings and the ranking should show, too.
Looking forward to your ideas!
Hi Sebastian,
Does the attached document illustrate my understanding to your question correctly?
I guess RowNo() as UID (that Kai Hilton-Jones
suggested) in the script shall help you.
Let us know how it goes.
Best wishes,
Hi Kadir,
I am testing the personal edition, cannot open your file - sorry!
Attached my try to include rowNo in the script, which apparently does not work (see table).
Best Regards
Sebastian
Checked here, you´re right.
I don´t know why is happening this way
This does not work because you have multiple records per a given dimension value, so QV does not know what to return for UID.
But anyway, it seems that wouldn't solve your problem, because you don't want a rowno determined during script load, but determined from chart y-values (I assume also you might want to dynamically filter the table).
If you just want to sort your avg value, then show the rank, I would suggest using the rank() function in your chart expression:
=num(rank(-Avg(rate_overall),4))
for average sorted asc, and without the minus sign for desc order.
Or if you want a fixed rowno, use
=rowno(total)
as expression (chart inter records limit the options QV allow to sort, check the Help for more detail) and use a sort expression like =avg(rate_overall) for the dimension.
I hope this helps,
Stefan
Hi!
"=num(rank(-Avg(rate_overall),4))" works fine but is limited to be tied to the rate_overall column.
So this should be considered as a workaround but not a solution.
Anyway this is the best answer so far!
Regards
Sebastian