Note: I cannot run the script because I don't have the source files, but try out the below code:
If(LineSalesAmount <50, 'Less than 50', 'Over 50') as 'Sales Check'
Sum(LineSalesAmount) as TotalSales
Group By %Key_Products;
AutoNumber(TotalSales) as Rank
Order By TotalSales desc;
DROP Table Temp;
Employees_ID as %Key_Employees,
(biff, embedded labels, table is Employees$);
Rank.qvw 698.2 K
This looks good. When I try and apply the same type of code to another app, the result of my AutoNumber does not start at 1. It starts at some other number.
I think this is because I am already using AutoNumber function in another field. If I use AutoNumberHash for example then it works because I am not using AutoNumberHas in another place.
Do you know how I can get it to start at 1?
see my example file rank.qvw.
- it contains a sub providing flexible ranking mechanisms,
such as ranking by autonumber or by rowno().
- ranks can be split into half ranks for identical values
(e.g. rank 11,12,13 -> 12, 12, 12)
Regards - Marcel