Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
What's the meaning of sum() function in this script
Temp1:
Load
CustomerNumber,
Sum(1) as TempId
Resident DimTemporary2
Group By CustomerNumber;
Drop Field TempId;
Left Join (Temp1)
Load
CustomerNumber,
Rowno() as TempId
Resident Temp1;
HI
Its count the customer count and display the result.
LOAD *,Date(Date#(Date,'MM/DD/YYYY'),'DD/MM/YYYY') as DateField INLINE [
ID, Date, Status,Values
A, 12/4/2012, Docs Received,1
A, 12/3/2012, Docs Sent,2
A, 12/2/2012, Docs Requested,3
B, 12/2/2012, Docs Sent,4
B, 11/1/2012, Docs Requested,5
C, 12/4/2012, Docs Requested,6
D, 12/3/2012, Docs Requested,7
];
Load Sum(1) as IDCount,ID Resident Test Group by ID;
In this, For ID - A, its IDCount - 3
B,2
C,1
D,1
But why you remove that field?
HI
Its count the customer count and display the result.
LOAD *,Date(Date#(Date,'MM/DD/YYYY'),'DD/MM/YYYY') as DateField INLINE [
ID, Date, Status,Values
A, 12/4/2012, Docs Received,1
A, 12/3/2012, Docs Sent,2
A, 12/2/2012, Docs Requested,3
B, 12/2/2012, Docs Sent,4
B, 11/1/2012, Docs Requested,5
C, 12/4/2012, Docs Requested,6
D, 12/3/2012, Docs Requested,7
];
Load Sum(1) as IDCount,ID Resident Test Group by ID;
In this, For ID - A, its IDCount - 3
B,2
C,1
D,1
But why you remove that field?
Thanks ![]()
And what about whit the left join in the same table loaded?
It joins the RowNo() field generated to the rtable loaded above based on the Customer number.