Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have this data which is Id and amount field i want to sum all row and store this into qvd data file. this time it is single fielf but need to add more field.
ECR-110,487512
ECR-110,369852
ECR-111,147852
ECR-112,369852
ECR-113,458236
-Jay
Hi,
If you are asking about the total amount then try this way in the script with store in any variable.
Table1:
LOAD * Inline [
Id,amount
ECR-110,487512
ECR-110,369852
ECR-111,147852
ECR-112,369852
ECR-113,458236 ];
TotalSale:
LOAD
Sum(amount) as Total
Resident Table1;
Store TotalSale into TotalSale.qvd;
If there is more fields then add that also and aggregate your data according to fields
Regards
Anand
Hi,
If you are asking about the total amount then try this way in the script with store in any variable.
Table1:
LOAD * Inline [
Id,amount
ECR-110,487512
ECR-110,369852
ECR-111,147852
ECR-112,369852
ECR-113,458236 ];
TotalSale:
LOAD
Sum(amount) as Total
Resident Table1;
Store TotalSale into TotalSale.qvd;
If there is more fields then add that also and aggregate your data according to fields
Regards
Anand
Try:
SummarizedValues:
LOAD
id,
SUM(Amt) AS SumAmount
RESIDENT
MyTable
GROUP BY
id;
STORE SummarizedValues INTO .....qvd (qvd);
DROP TABLE SummarizedValues;
HTH Peter
Is this works when i add more fields then how it comes.
Jay
Yes it is worked then write
Table1:
LOAD * Inline [
Id,amount
ECR-110,487512
ECR-110,369852
ECR-111,147852
ECR-112,369852
ECR-113,458236 ];
TotalSale:
LOAD
Sum(amount) as Total
Resident Table1
Group By Id;//And add here more fields
Regards
Anand
Thanks all of you for nice response for clearing me, sorry it is small question.
Jay
tst