Get percent complete in Gantt chart

I need to get percent complete in Gantt chart per below request.
Filter column `Region_TWC` to get each filtering. ‘NAM’ , ‘EUROPE’ , ‘PACIFIC’ , ‘JAPAN’ , ‘KOREA’ , ‘GCA’ , ‘SEA’.
Then filter column `Meet FOB DL_AR`, to get the rows which is equal to 'Meet AR DL'
After above filtering, to get each region’s total `Ordered unit` in column `Ordered unit`.
Comparing each region’s total `Ordered unit’ to SUM(distinct(`PAR in PQ`)) in column `PAR in PQ`
If total `Ordered unit` is equal or more than SUM(distinct(`PAR in PQ`)), return SUM(distinct(`PAR in PQ`)) else return total `Ordered unit`.
Use the return number to be divided by SUM(distinct(`PAR in PQ`)) to get percent complete in Gantt chart.
I created below calculated field to get each region subtotal number.
CASE
WHEN SUM(CASE WHEN `Region_TWC` IN ('NAM','EUROPE','PACIFIC','JAPAN','KOREA','GCA','SEA')
AND `PO Type` IN ('Sample','Demo','SF','M0','M1') AND `Meet FOB DL_AR`= 'Meet AR DL' THEN `Ordered unit` END)
>= SUM(DISTINCT `PAR in PQ`)
THEN SUM(DISTINCT `PAR in PQ`)
WHEN SUM(CASE WHEN `Region_TWC` IN ('NAM','EUROPE','PACIFIC','JAPAN','KOREA','GCA','SEA')
AND `PO Type` IN ('Sample','Demo','SF','M0','M1') AND `Meet FOB DL_AR`= 'Meet AR DL' THEN `Ordered unit` END)
< SUM(DISTINCT `PAR in PQ`)
THEN SUM(CASE
WHEN `Region_TWC` IN ('NAM','EUROPE','PACIFIC','JAPAN','KOREA','GCA','SEA')
AND `PO Type` IN ('Sample','Demo','SF','M0','M1')
AND `Meet FOB DL_AR`= 'Meet AR DL' THEN `Ordered unit`END)
END
However, when I generate Sum of each region subtotal number, I found it is not aligned to total number. Total number 38k vs. 34k if just sum of each region’s number.
Answers
-
To get an answer, I recommend you break up this question and ask just the first part. If you're still stuck after that, ask the next part. There's a lot going on and it's not clear what you're asking.
At the end of your question, it seems like you're asking about why your sums aren't aligned 38K vs. 34K. I'm not sure how you're getting those sums, but I see a number of the BeastModes above using DISTINCT inside the SUM. This can often cause differences when breaking into groups vs. looking at it as a whole, as what is 'distinct' changes when broken up vs. looking at it as a whole. For example:
Country
Order Units
Sum Distinct by Country
Sum Distinct Total
NAM
1
2
16
NAM
1
EUROPE
1
16
EUROPE
5
EUROPE
10
Please 💡/💖/👍/😊 this post if you read it and found it helpful.
Please accept the answer if it solved your problem.
0 -
David,
sorry for confusion. Let me explain it more clear.
Below is the example:
- I have a PO list in the table and would like to get each region's data per my beast mode.
- Per my request, if "Ordered unit" is equal or more than "PAR in PQ" and "Meet AR DL", return "PAR in PQ" else return "Ordered unit".
- When I run the best mode, it will be correct when filtering each region. However, if I don't do filter but only want to see the sum of all regions, it will be wrong because the mode will only comparing total number in "Ordered unit" and "PAR in PQ".
Could you help check it again?
0
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
- 116 SQL DataFlows
- 2.2K Magic ETL
- 816 Beast Mode
- 3.3K Visualize
- 2.5K Charting
- 82 App Studio
- 45 Variables
- 776 Automate
- 190 Apps
- 481 APIs & Domo Developer
- 82 Workflows
- 23 Code Engine
- 40 AI and Machine Learning
- 20 AI Chat
- 1 AI Playground
- 1 AI Projects and Models
- 18 Jupyter Workspaces
- 411 Distribute
- 120 Domo Everywhere
- 280 Scheduled Reports
- 11 Software Integrations
- 144 Manage
- 140 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