Last 7 days COUNT for each day
Goal: I want a total COUNT of rows for the last 7 days, for each day. Meaning, that I have Ex. a line graph where the point for 5/22 includes the previous 7 days (5/15 - 5/21) and the point for 5/21 would be the total of 5/14-5/20 and so on.
Context: I append data every 15 minutes to a dataset that shows the current users online at that time. I'm trying to report every day on the # of users for the last 7 days. I'm trying to brainstorm if I can do this in a beastmode before going the route of a dataflow.
Sample Data:
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**
Comments
-
Hey,
Let me know if this works.sum(case when `activedatetime` >= current_date() - 7 then 1 else 0 end)
thanks
1 -
Thanks for the response,
something like that is what I was originally going for but realized it's not going to work.
I would want to look back on say 5/1 and see what the sum of online users was for the previous 7 days to that, and so forth for any day of any month. using current_date only allows me to have a number that shows the last 7 days from current day.
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**1 -
Ah my apologies i thought you wanted the last 7 days from today. I believe you wont be able to do this in a beast mode with the existing fields. Since, the data loads every 15 minutes i dont believe creating a dataflow would be an issue unless the dataset isnt too large.
2 -
I agree. I think you will need to engineer this field within a dataflow. Are you always going to want a running 7 day total?
Is this already part of an ETL or MySQL dataflow?
If you want help manipulating the dataflow, please share the input file structure and any steps already in place.
1 -
Thanks guys, I figured I was hoping too much from a beast mode in this case but I've seen some crazy ones so wanted to check before going to a dataflow. I'll attempt to do this and make progress in a dataflow before asking for you to do work to help me.
**Make sure to like any users posts that helped you and accept the ones who solved your issue.**0 -
Did you figure this out?
0 -
https://www.youtube.com/watch?v=cnc6gMKZ9R8
You could use the LAG() window function in beast modes (you may need to ask your CSM to enable the feature switch).Alternatively, see if you can get a hold of the Domo Data View beta, it can be optimized for performance which may be necessary given that your data is updating frequently.
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"1 -
Thank you. Glad this is not in ETL. And thanks for creating a channel on YouTube. I have been waiting for someone to this this for a while.
0
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
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 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