Forum Discussion
Merge rows contain different time values
Hello,
I have this database where all the agents are filling their time as and when they perform any task in the given ID #. This is resulting in duplication of ID# as shown below and their unique Time.
1) How can i sum up individual IDs time and merge the duplicate rows?
2) Their are other rows that has the same time but still showing duplicate IDs. How can i merge them as well without summing up the timings?
| ID | Agent Name | Time in Seconds |
| 85 | Ira | 7200 |
| 85 | Ira | 144000 |
| 85 | Ira | 14000 |
| 85 | Ira | 2400 |
| 85 | Ira | 40000 |
| 85 | Ira | 23000 |
| 85 | Ira | 14000 |
| 288 | Isha | 63 |
| 288 | Isha | 63 |
| 288 | Isha | 63 |
| 288 | Isha | 86400 |
| 288 | Isha | 86400 |
| 288 | Isha | 86400 |
- Anonymous8 years ago
Or are you trying to get the following results vsinne?
TableName = SUMMARIZE ( sourceTable, sourceTable[ID], sourceTable[Agent Name], "Total Time", SUMX(DISTINCT(sourceTable),sourceTable[Time in Seconds] ) )
5 Replies
- MarcoRottaResolver I
I'm assuming you want to sum the times and keep only a single record of the other fields, and you want to do that in your data model. If so, starting from the big combined table you already have, try to use the "Group by" option in the "Tranform" menu inside query editor. That would generate the output you require.
Regards.
- AnonymousNot applicable
From Modeling create a New Table as follow:
TableName = SUMMARIZE ( sourceTable, sourceTable[ID], sourceTable[Agent Name], "Total Time", SUM(sourceTable[Time in Seconds]) )Let me know if I didn't undertood your requirements correctly.
- AnonymousNot applicable
Or are you trying to get the following results vsinne?
TableName = SUMMARIZE ( sourceTable, sourceTable[ID], sourceTable[Agent Name], "Total Time", SUMX(DISTINCT(sourceTable),sourceTable[Time in Seconds] ) )- vsinneFrequent Visitor
Yes, this is the result i am expecting to yield. how can i merge those rows that has just the duplicate values? thank you so much for your help.