Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am trying to use a Sum function in load script where I want to sum the quantity by Product Code (Quantity and Product Code are two fields) and couple of other conditions as in where clause in syntax below. I used Group by Product Code. I get an error below:
I really appreciate any help on this
Thanks
Monica
The following error occurred:
Invalid expression
The error occurred here:
Composite: NoConcatenate Load *, Sum(Quantity) AS All_Qty Resident OpportunityWon where IsPrimary__c = 1 AND [Close Date] > 42552 Group by [Product Code]
Composite:
NoConcatenate
Load *,
Sum(Quantity) AS All_Qty
Resident OpportunityWon
where IsPrimary__c = 1 AND [Close Date] > 42552
Group by [Product Code];
Not Sure about this, Try mentioning column names instead of "*"
the '*' is the problem. You either need to group by all these fields individually or remove from the script.
Hi,
You need to define all individual columns in Group by. Remove * and list all the columns required and specify the same in GROUP BY Clause.
Composite:
NoConcatenate
Load
[Product Code],
Colum2,
Column3,
Sum(Quantity) AS All_Qty
Resident OpportunityWon
where IsPrimary__c = 1 AND [Close Date] > 42552
Group by [Product Code],
Column2,
Column3;
Hope this helps you.
Regards,
Jagan.
Instead of load * , mention all field names and include all those fields in group by
Try
Load
[Product Code],
Sum(Quantity) AS All_Qty
Resident OpportunityWon
where IsPrimary__c = 1 AND [Close Date] > 42552
Group by [Product Code]
Hi mchhabra
'*' is the problem. You need to group by all these fields individually or remove other fields from the script
or Else
Try this,
Load
[Product Code],
Sum(Quantity) AS All_Qty
Resident OpportunityWon
where IsPrimary__c = 1 AND [Close Date] > 42552
Group by [Product Code];