Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everybody. I´m having problems with this easy thing.
I have this and i dont know where put the ORDER by, i tried a few examples but they don't work.
SDS:
LOAD
EMPRESA,
DIVISION_A,
RESIDENT TMP_SALDOSINICIALES
GROUP BY
EMPRESA,
DIVISION_A,
DROP TABLE TMP_SALDOSINICIALES;
left join
LOAD DISTINCT
YEAR
FROM
[DIARIO.QVD]
(qvd);
Group by can be used if you are aggregating something on script lever... Example shown below
Sales:
Load Customer, Date, Sales From TableName;
TotalSales:
Load Customer, SUM(Sales) as TotalSales Resident Sales Group By Customer;
Hope this will clear your doubt...
Hi,
Group by will work only if there is any aggr functions such as min,max,avg,count,sum etc is defined for that table.
sory i made a mistake
i wanted to say ORDER BY i was thinking in another thing
Load your table like
tmpSDS:
LOAD
EMPRESA,
DIVISION_A,
RESIDENT TMP_SALDOSINICIALES
DROP TABLE TMP_SALDOSINICIALES;
left join
LOAD DISTINCT
YEAR
FROM
[DIARIO.QVD]
(qvd);
Noconcatenate
FinalTable:
LOAD
EMPRESA,
DIVISION_A,
RESIDENT tmpSDS
Order BY
EMPRESA,
DIVISION_A;
Drop Table tmpSDS;
Check this script
Regards,
Anand
sory i made a mistake
i wanted to say ORDER BY i was thinking in another thing
//Hoping that TMP_SALDOSINICIALES already loaded in the script before using Resident TMP_SALDOSINICIALES
NoConcatenate
SDS:
LOAD
EMPRESA,
DIVISION_A,
RESIDENT TMP_SALDOSINICIALES
Order BY EMPRESA, DIVISION_A;
DROP TABLE TMP_SALDOSINICIALES;
left join
LOAD DISTINCT
YEAR
FROM
[DIARIO.QVD]
(qvd);
Yeah, thats right. The table tmp_saldos is loaded.
But i dont see the group by in that table. My table is this and in this way it´s works fine
SDS:
LOAD
EMPRESA,
DIVISION_A,
RESIDENT TMP_SALDOSINICIALES
GROUP BY
EMPRESA,
DIVISION_A,
DROP TABLE TMP_SALDOSINICIALES;
left join
LOAD DISTINCT
YEAR
FROM
[DIARIO.QVD]
(qvd);
Thank you!
I am confused now.... You want order by or group by?
I wasn´t very clear, sory for that. I have that table with a group by. It´s work fine.
I want to have an order by in that table.