Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Could anyone help me how to write Sum(Amount) in Load statement instead of Expression in pivot table.
Thanks.
A sum into script must include a group by clause
LOAD
ID,
sum(Amount) as Amount_sum
FROM
[your Qvd]
Group by ID;
Amelia
Just like that. For example:
LOAD AccountID,
Sum(Amount) As Amount
Resident Accounts
Group By AccountID
All non-aggregated fields (AccountID in this example) should be in a Group By clause.
Regards
Jonathan
Hello Amelia,
The Sum() function aggregates your data according to a group of fields. So let's say you would like to summarize the total sales of a product per month, your load statement would look something like this:
MonthlySales:
LOAD MonthStart(OrderDate) as OrderMonth
, Product
, Sum(Amount) as MonthlySales
Group By MonthStart(OrderDate), Product;
LOAD OrderDate
, Product
, Amount
From ...
Regards,
Philippe
Thanks and I used same but it's getting
Error: Invalid Expression while reloading
Could you help how to solve this.