Sum value on a specific time window deduplicating
Hi all,
I'm trying to solve something a bit weird. It was working correctly, and without doing anything, my card is not working anymore. When I'm editing it, it's completely broken
Type of data
date|service|daily_service_sales|placement|daily_placement_sales
2021/04/01|Service_A|80|Placement_AA|10
2021/04/01|Service_A|80|Placement_AB|12
2021/04/01|Service_B|40|Placement_BA|13
2021/04/01|Service_A|90|Placement_AA|20
2021/04/01|Service_A|90|Placement_AB|10
2021/04/01|Service_B|30|Placement_BA|8
2021/04/01|Service_B|30|Placement_BA|6
What I'm trying to achieve is to build a is a Line + Grouped bar chart per week with 3 types of data
You can notice that the daily_service_sales values is repeated each time a placement is performing
3 beast mode are used into the following card
weekly_service_sales : sum of unique daily_service_sales per week
(SUM(SUM((daily_service_sales)) OVER(partition by YEAR(`date`),WEEK(`date`), `service`))
weekly_placement_sales: sum of daily_placement_sales per week
(SUM(SUM((daily_placement_sales)) OVER(partition by YEAR(`date`),WEEK(`date`), `service`))
weekly_ratio : weekly_placement_sales / weekly_placement_sales
The current card
When I'm trying to edit it or trying to create a new one.
Am I doing something wrong?
Help me please,
Julien
Comments
-
Can you share the chart properties? Are you sorting by anything?
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
How are you grouping your dates in analyzer? Are you showing it by day or none or by week?
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks for trying to help me
I 'm sortering my graph by date. And I don't have so much specific properties
I'm trying to show this graph per week. As you can see, on the second chart, there is a multiplication of number of week.
When I'm trying to share calculation through Dataset, the duplication on the graph is happening.
0 -
And now, when I'm trying to build a new dashboard from a new data set with new beast mode, duplciation of week is happening all the time.
0 -
Here is the result
And when I'm filtering on a specific service:
0 -
You need to remove
service
from the partition by clause.That is why you are getting an extra row of data for each type of service that was present in that week
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
What I want to get is the chart per week. Fully aggregated. and I have another card to be able to select Service(s) and/or placement(s)
Here is the graph with those beastmode
weekly_placement_sales: (SUM(SUM(`daily_placement_sales`)) OVER(partition by YEAR(`date`),WEEK(`date`)))
weekly_service_sales : (SUM(SUM(`daily_service_sales`)) OVER(partition by YEAR(`date`),WEEK(`date`)))
Ratio:
(SUM(SUM(`daily_placement_sales`)) OVER(partition by YEAR(`date`),WEEK(`date`)))
/
(SUM(SUM(`daily_service_sales`)) OVER(partition by YEAR(`date`),WEEK(`date`)))
0 -
Can you change the x-axis to be MIN of the date field?
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Impossible to achieve that.. I really don't understand why it's not working
0 -
I believe Domo broke this functionality back in Feb of this year and never fixed it. you can't do math on the PARTITION BY clause on Dates and then aggregate to the week using the Date filter grouping functionality.
Instead, calculate YearWeek as a materialized column on your dataset and change your Partition By Clause to use the new YearWeek column.
Also be careful. YearWeek the way you calculated it will break near the start of January and end of December each year.
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"0 -
Depending on how you count your weeks you could also calculate the first day of the week or the last day of the week so that you have a continuous week and not have issues with the start / end of the year. This is assuming you'd count a week that started on 12/30/2020 as the last week in 2020 and would include 12/30/2020 - 1/5/2021.
Here's a post I did about calculating the first and last days of the week with a beast mode (you could do this in a dataset view) but can easily be converted to an ETL 2.0 formula tile:
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**0 -
Thanks both, let met investigate and come back to you
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive