Forum Discussion
Inbound /Outbound Date difference calculation
- 4 years ago
So I'm not finished, but am getting close.
As you will see, I really need an answer to the duplicate timestamps.
These present a significant problem.
Scenario A = CASE ID 102
1) Create the following "Order" column.
It is imperative that this column groups by both [CASE ID] & [Direction].
The purpose of this column is to label in order (from 1 to N) the lowest timestamp to the highest timestamp within each grouping of CASE ID & Direction.
NOTE: In this case, I am isolating CASE ID 102 to simplify the example.
2) Create a new table called "Inbound" as follows, including only the Inbound rows.
NOTE: I renamed column "Created On" to "Date In".
3) Create a new table called "Outbound" as follows, including only the Outbound rows.
4) In the Inbound table, create the following columns:
- Date Out
NOTE: THIS IS WHERE THE MAGIC HAPPENS! WE'RE LINKING [Date In] TO [Date Out] BASED ON [Order]!
- Difference DateDiff (in minutes)
- Difference Operator (in HH:MM:SS)
NOTES: I provided Difference in 2 different ways. Use whichever you like.
Scenario B = CASE ID 101
- As you can see in Line 10 & 11, there are 2 identical rows for CASE 101 & Direction Outbound. As a result, both rows get assigned Order #2. For this reason, no Order #1 gets created for 101 Outbound, and therefore, cannot match up correctly with Order #1 for 101 Inbound. The end result, is incorrect matching & incorrect calculations.
- There is a similar problem with Line 4 & 6. There are 2 identical rows for CASE 101 & Direction Inbound. I don't understand how Order selected Row 6 as "Order 1" & Row 4 as "Order 2". But this really doesn't matter since we don't know which one should come first anyway. So it could be right or wrong, but we have no way to know.
Finally, as you can tell, I have also not yet programmed in the rule about [Date In] needing to be LESS THAN [Date Out] for it to be valid. If you get stuck on this one, let me know and I will come back to you.
Before worrying about that though, you either need to:
1) Remove identical duplicate rows (OR)
2) Clearly specify how to handle identical duplicate rows, if they are in fact, legitimate.
Hope what I have provided so far is helpful to you!
Regards,
Nathan
Hello karthickpbi -
- The new dataset you provided on Saturday (Case ID's: 101 & 1023) is significantly different from the original dataset provided (Case ID's: 101, 102, 103, 104). Since there are new requirements based on the new columns in the new dataset, I am abandoning the original datset in favor of the new one.
- For readability (and for easier column reference in DAX), I have shortened and/or renamed columns as follows:
- "To Recipients" => "Recipient"
- "Sender Email domain" => "Sender Domain"
- "Torecipient email domain" => "Recipient Domain"
- "Inbound Internal or External" => "Inbound Type"
- "Outbound Internal or External" => "Outbound Type"
- "Internal Email / External Email" => "Process"
- Regarding your post with 6 points, I want to make sure I'm understanding correctly.
1. We want to:
- Exclude WHERE [Process] LIKE '%Internal%' (NOT highlighted below)
- Include WHERE [Process] IN ('External Received', 'External Handled')
- (highlighted yellow below)
- Result: We only keep Gmail.com / Dell.com conversation
- dell to gmail (highlighted orange)
- gmail to dell (highlighted blue)
- FINAL RESULT: We only keep the rows marked in green!
- Keep only Lines: 3, 6, 7, 9, 13-17
- Exclude all other lines.
- Lines 18, 27-29 have [Process] LIKE '%External%'. However, they are EXCLUDED because the conversation is NOT between dell.com & gmail.com.
- Am I understanding everything correctly so far? Please make any corrections.
2. "INBOUND : Will always send from [email protected] to [email protected](Dell.com)"
- I don't see either of these email addresses in the new dataset.
- So perhaps this is another way of saying the conversation is between
@gmail.com & @dell.com? But this is already stated in Point #1.
- So I'm ignoring Point #2.
- Correct me if I'm misunderstanding.
3. "Outbound : will always send from [email protected](Dell.com) to [email protected]."
- I'm ignoring Point #3 for the same reason as Point #2.
- Correct me if I'm misunderstanding.
4."Note: In Inbound 90% will always Inbound sender Outbound of torecipient is same customer only (External(Gmail.com))"
- My apologies. I'm not sure what this means.
- Are you simply saying that 90% of the time, the Sender Domain for external emails will be @gmail.com?
- There is no filter criteria for this point, correct? It's just an FYI, right?
5. "Inbound = customer sending (Sender)email to agent (to receipient)"
- There is no filter criteria for this point, correct? It's just an FYI, right?
6 Outbound = agent sending (sender) email to customer sending (to receipient)
- There is no filter criteria for this point, correct? It's just an FYI, right?
Again, please make any corrections to my understanding of new requirements, as needed.
Regards,
Nathan
You are correct.
conversation between 2 domains.
- we need to apply filter and exclude Internal convrsation bcz we are showing i the Report but Not considering the Date difference. we need to consider only for External Conversation.
Here We need to calculate date is.
EX:
we need to apply sort on created on and each case we have Multiple conversation right.
Each Inbound and outboud conversation , need to consider first Inbound and First outbound and then after that any outbound will notbe consider until net inbound.
again we have received one or More inbound.. after outbound , we need to consider first Inbound an dFirst Outbound, Like FIFO