I am using 2 lookup tables to correlate and combine data to create a new .csv. In this process, I have a field that has numerical values in it that i want to sum based on the values of another field. The raw data looks something like this:
stage,resource,hours x,rick,1 x,rick,10 x,dave,1 y,rick,5 y,dave,3 y,dave,8
I want the output to look like: x,rick,11 x,dave,1 y,rick,5 y,dave,11
Below is the search I have, it almost works but it does not sum the totals for rick and dave individually, it sums them all, so the output looks like:
x,rick,12 x,dave,12 y,rick,16 y,dave,16
|inputlookup mod_master |lookup lookuptable1 Engagement OUTPUTNEW ResourceLastName,RegularHours | eval Resource=mvdedup(ResourceLastName) | mvexpand Resource | eval Hours=sum(RegularHours) | fillnull value=0 Hours | table Stage,Resource,Hours
How can i change the logic in this search so I get the correct individual sums for Rick and Dave and not the combined total for each? Thank you in advance!
... View more