Counting Dates on a date rage
In my business we sell a monthly service. A customer is either acivated or deactivated. I have a dataset that has 2 date columns (activation date and deactivation date). I can easily create 2 separate cards that show the number of activations and deactivations every month. The activation card would have the activation date (X axis) and count of activation date (Y axis). However, I want to combine those 2 cards so that I can see the number of activations every month compared to the number of deactivations every month. How do I do this with the Date Rage Field \ X axis being restricted to one of those 2 dates?
Best Answer
-
Hi Jferrara,
You'll need to do some sql on the backend (at least that's what we've done) that essentially adds a new line for every month that a customer is active with a count of 1. Then, when the customer is listed as deactivated, it returns a value of -1. This way, you'll have a new field of Customer Status, and your customer will be listed as "Active" every month until they are deactivated, where their status will then change to "Inactive". We used the mysql tool to write this code. Thanks!
1
Answers
-
Hi Jferrara,
You'll need to do some sql on the backend (at least that's what we've done) that essentially adds a new line for every month that a customer is active with a count of 1. Then, when the customer is listed as deactivated, it returns a value of -1. This way, you'll have a new field of Customer Status, and your customer will be listed as "Active" every month until they are deactivated, where their status will then change to "Inactive". We used the mysql tool to write this code. Thanks!
1
Welcome!
Categories
- All Categories
- 2K Product Ideas
- 2K Ideas Exchange
- 1.6K Connect
- 1.3K Connectors
- 311 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 3.8K Transform
- 659 Datasets
- 117 SQL DataFlows
- 2.2K Magic ETL
- 816 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 84 App Studio
- 46 Variables
- 778 Automate
- 190 Apps
- 482 APIs & Domo Developer
- 83 Workflows
- 23 Code Engine
- 41 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 2 AI Projects and Models
- 18 Jupyter Workspaces
- 411 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 11 Software Integrations
- 145 Manage
- 141 Governance & Security
- 8 Domo Community Gallery
- 48 Product Releases
- 12 Domo University
- 5.4K Community Forums
- 41 Getting Started
- 31 Community Member Introductions
- 115 Community Announcements
- 4.8K Archive