Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all. I need to create a calculated field in my data load that counts the number of items a user has. For example, if this were my table:
The field (Count of Units) would provide this:
I hope this makes sense; I don't even know where to start to accomplish this.
Detail:
load * Inline [
Unit,User
10025,usr1
10026,usr2
10027,usr3
10028,usr1
10029,usr1
10030,usr3
10031,usr4
];
Summary:
load User
,Count(Unit) as [Count of Units]
Resident Detail
group by User;
Detail:
load * Inline [
Unit,User
10025,usr1
10026,usr2
10027,usr3
10028,usr1
10029,usr1
10030,usr3
10031,usr4
];
Summary:
load User
,Count(Unit) as [Count of Units]
Resident Detail
group by User;
Thank you! I do have a question though (it might be a stupid one, sorry if it is). The above was just an example to illustrate what I needed, but my actual data contains tens of thousands of users and items. I don't understand how to create an inline table in that case?
I used the inline table to demonstrate the aggregation. The resident command would refer to the table that you load in you script.
Ah, I understand now. Thank you so much!