You can do this by a 2-step approach, first GROUP BY the field, then inner join itself by the ORDER BY ...
Load [Staff Group], Sum(DNA) as TotalDNA
group by [Staff Group];
first 3 load [Staff Group], TotalDNA
order by TotalDNA;
Another way is to use an ODBC connection to your excel file where you can group by and order by in one command ...
ODBC CONNECT32 TO [Excel Files;DBQ=StaffGroup.xls];
SQL SELECT top 3 [Staff Group], Sum(DNA) as TotalDNA
group by [Staff Group]
order by Sum(DNA);
I'm having the same problem, but in the answer they forgot the filter:
where [Date] > $(#vAYearAgo) and [Date] < $(#vToday).
This is my script:
LOAD `IT_ICODE` as [Codigo de Producto],
`IT_WHCODE` as [Codigo Almacen],
`IT_LOCAL` as Sucursal,
`IT_QTY_SHP` as QtySales;
SQL SELECT *
FROM `C:\USERS\LAURA NU\DOCUMENTS\COMETA\QLIK VIEW\COMETA\DBF`\itransd;
load [Codigo de Producto],
sum(QtySales) as QtyVendida2
where QtySales >0;
And is very important for me to filter with positive values.