Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
i Used this script to sort client for each agency and load only the 20 first
agence:
LOAD distinct
agenc
FROM
(qvd);
for vRow = 1 to NoOfRows('agence')
Let MyVar = Peek('agenc',vRow-1,'agence');
first 20
HGFINAL:
load *
FROM
(qvd)
Where AGENCE = '$(MyVar)'
order by PNB ;
Next
But nothing changed
You can use the Order By clause only on resident loads. So you first need to load the data in a temporary table. Then you can do a resident load from that temporary table and use the Order By to sort it.
agence:
LOAD distinct
%ID_AGENCE_CTOS_CLIENT
FROM
(qvd)
;
Temp:
LOAD
*
FROM
(qvd)
WHERE
Exists(%ID_AGENCE_CTOS_CLIENT )
;
DROP TABLE agence;
Result:
LOAD
*
WHERE
Counter <= 20;
LOAD
*,
AutoNumber(RecNo(), %ID_AGENCE_CTOS_CLIENT) as Counter
RESIDENT
Temp
ORDER BY
%ID_AGENCE_CTOS_CLIENT,
PNB
;
DROP TABLE Temp;
DROP Field Counter;
You can use the Order By clause only on resident loads. So you first need to load the data in a temporary table. Then you can do a resident load from that temporary table and use the Order By to sort it.
agence:
LOAD distinct
%ID_AGENCE_CTOS_CLIENT
FROM
(qvd)
;
Temp:
LOAD
*
FROM
(qvd)
WHERE
Exists(%ID_AGENCE_CTOS_CLIENT )
;
DROP TABLE agence;
Result:
LOAD
*
WHERE
Counter <= 20;
LOAD
*,
AutoNumber(RecNo(), %ID_AGENCE_CTOS_CLIENT) as Counter
RESIDENT
Temp
ORDER BY
%ID_AGENCE_CTOS_CLIENT,
PNB
;
DROP TABLE Temp;
DROP Field Counter;
thank you thank but just you need to put desc with order by