How to Deal with Multiple Date Fields
I have a perplexing issue I'm trying to solve. I have data coming from several different data sources (all parts of Zendesk), each of which each represent a different kind of user interaction.
For example: Email, Chat, Phone Calls
These are all related to a master "Tickets" table, so they can be joined based on a Ticket ID. A single ticket can have multiple Emails, Chats, Phone Calls, etc. Each table (chats, calls, emails) has its own date and time stamp.
When I Left Outer join each of these tables to the tickets table, I end up with a dataset that ends up with all of the dates in it, and I can't determine the actual interaction date - which is what I need for filtering on cards and dashboards.
I tried a Beast Mode calculation that says if there's a Chat ID in the row, use the Chat Date; if there's a Call ID in the row, use the Call Date, etc., but that doesn't work, since each row has ALL of the dates after the joins are complete.
I've been beating my head against the wall on this for a week now. Does anyone have ideas on how I might be able to determine the specific interaction date?
Answers
-
@pstrauss If you just have single charts for each interaction (Emails, Chats, Phone Calls, etc.) then you can just graph by the interaction specific data. If you want everything to function off of a single date (all Emails, Chats, and Phone Calls for Jun 2022), then you'll have to stack your data. Instead of joining, you would append or union the tables with an additional column for each table that identifies what that table is. Then your chat date, call date, etc. all fall in a single date column, and your data would be organized like this:
You'll then need to create beast modes to count each type of interaction:
SUM(case when 'Type' = 'Email' then 1 else 0 end)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2 -
@RobSomers thanks for the quick response and suggestion. We already have separate charts per interaction type, but the business is looking for totals across all interactions by date. Hence the requirement.
If I'm not joining the data and instead appending it, how will the ETL process handle it when each table has many different columns? Will it just leave those null when combining tables?
0 -
@pstrauss There a couple of options for handling different columns. Here's an article on appending and differing rows:
The best way to guarantee that everything works together would be to select the specific columns from each table that you'll be using, and if certain tables don't have a specific column, just adding that column to the other tables with a null value before the append. Depending on the columns in each dataset, you can also experiment in the Append Rows tile with the options for what columns to use.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2 -
Got it. This is really helpful @RobSomers. I've already made some progress with a prototype using your suggested approach.
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 755 Beast Mode
- 61 App Studio
- 41 Variables
- 693 Automate
- 178 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive