% of Total Sales Column Add
Hello All,
New to Domo and appreciate the community support.
I have a table card that includes net sales by cashier listed for the day in descending order. I would like to add a column that shows their sales as a % of total sales for the day.
How would I do this ?
Thanks !
Best Answer
-
@leonardschlemm , what @swagner gave you is called a window function. this is a common implementation in SQL which can be googled!
assuming you have cashiers on the axis, you should be getting that cashiers sales as a percent of total sales.
if you want that cashiers sales as a percent of store sales or some other subtotal method, add a partition by clause.
sum(sum(amount)) over (partition by `store`)
I have a couple videos on my channel on the topic.
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
Answers
-
Try this:
If the Sales beast mode is SUM(`Sales`), then the % of Sales beast mode would be:
SUM(`Sales`) / SUM(SUM(`Sales`)) OVER()
0 -
thanks for quick response. how would i reference the cashier in this function ? the cashier data line is a dimension
0 -
@leonardschlemm , what @swagner gave you is called a window function. this is a common implementation in SQL which can be googled!
assuming you have cashiers on the axis, you should be getting that cashiers sales as a percent of total sales.
if you want that cashiers sales as a percent of store sales or some other subtotal method, add a partition by clause.
sum(sum(amount)) over (partition by `store`)
I have a couple videos on my channel on the topic.
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 -
Thanks !
0
Categories
- All Categories
- 1.7K Product Ideas
- 1.7K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 292 Workbench
- 4 Cloud Amplifier
- 8 Federated
- 2.8K Transform
- 95 SQL DataFlows
- 602 Datasets
- 2.1K Magic ETL
- 3.7K Visualize
- 2.4K Charting
- 691 Beast Mode
- 43 App Studio
- 39 Variables
- 658 Automate
- 170 Apps
- 441 APIs & Domo Developer
- 42 Workflows
- 5 DomoAI
- 32 Predict
- 12 Jupyter Workspaces
- 20 R & Python Tiles
- 386 Distribute
- 111 Domo Everywhere
- 269 Scheduled Reports
- 6 Software Integrations
- 112 Manage
- 109 Governance & Security
- 8 Domo University
- 30 Product Releases
- Community Forums
- 39 Getting Started
- 29 Community Member Introductions
- 98 Community Announcements
- Domo Community Gallery
- 4.8K Archive