Tableau-like Parameter actions
I am trying to allow a user to filter a chart that uses an aggregation. My data looks like this:
I want a user to be able to choose 'Apple' and then the ensuing line chart would show percentage of items each day that were apple (40% over 1/1, 30% over 1/2, and 60% over 1/3).
In tableau, I would set up a parameter (p_fruit) containing all values in the 'Fruit' column. I would then set up an aggregation something like this:
sum( case when 'Fruit' = p_fruit then 'Items' else 0) / sum('Items')
Is it possible to recreate this type of functionality in Domo?
Best Answer
-
@gbuckley , Domo does not support parameterization the way you're thinking.
You can recreate the metric you're looking for by altering your data model.
APPEND a copy of your data to the dataset, and in the second set, replace Fruit w/ "All-Fruits", then your users can filter on "Apple" OR "All-Fruits" and with that slice of data you can calculate your ratio without relying on a window function
sum(case when fruit <> 'All-Fruits' then ... ) / sum( case when fruit = 'All Fruits' then ... )
Alternatively, you can do a cartesian product of each row of the dataset for each fruit for each day. so on a day where you have 2 fruits you'd have 4 rows, on a day with 5 fruits you'd have 25 rows.
select a.fruit as 'fruit_ignoreMe' c.fruit as 'fruit_report' case when a.fruit = c.fruit then amount as numerator, a.amount as denominator from trans a, JOIN (SELECT distinct fruit, date) c on a.date = c.date
then your beast mode is sum(numerator) / sum(denominator)
use fruit_report as the filter. when you filter on "apple" you'll have a copy of EVERY row for the day, but the numerator will only be apples, and denominator will contain everything.
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
-
Are you familiar with drill paths in Domo? This will do what you are wanting to do and doesn't require any parameter passing as Domo takes care of that for you. You can watch this Domo video for a quick tutorial on it: https://www.domo.com/help-center/videos/watch/eB3jtaWAvAs
You could also design your page as a dashboard and configure the interaction filters to allow one card to affect other cards on the page.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.0 -
Hi Mark, I don't think that drill paths or card interactions address my issue. Both of those techniques filter the underlying data driving the card. For example, I build a simple bar chart for fruit:
Then I build a drill path so that clicking on the apple bar takes me to the line chart. But since the underlying data is filtered to show only rows with "Apple" in the 'Fruit' column, the percentage will always be 100%
The same will be true for card interactions. I want to use a parameter-like thing to select certain rows for the aggregation, but NOT filter the whole dataset.
This was the beast mode I used for the line chart:
Partitioning by 'Date' (the finest detail in the dataset) allows the user to choose their own timeframe and the calculation should still work. If 'Fruit' is passed as the Series, we get the line chart with the proper percentages. But I only want to show one line at a time (the fruit the user chooses) since in my actual use case we have 9 'fruits' so the chart gets quite messy
0 -
Hi @gbuckley
you can control which lines are shown after aggregation has applied by clicking on the legend. So you could hide all the other fruits except apples and allow the user to select which fruit they want to display on the chart.
Alternatively you could pre aggregate your data in an ETL and calculate your overall percentage based on the total using the rank and window tile in a magic Etl. Then when the user filters the data it would have the percentage for the entire dataset still and wouldn’t be affected by the filtering but only show your filtered fruit.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**1 -
@gbuckley , Domo does not support parameterization the way you're thinking.
You can recreate the metric you're looking for by altering your data model.
APPEND a copy of your data to the dataset, and in the second set, replace Fruit w/ "All-Fruits", then your users can filter on "Apple" OR "All-Fruits" and with that slice of data you can calculate your ratio without relying on a window function
sum(case when fruit <> 'All-Fruits' then ... ) / sum( case when fruit = 'All Fruits' then ... )
Alternatively, you can do a cartesian product of each row of the dataset for each fruit for each day. so on a day where you have 2 fruits you'd have 4 rows, on a day with 5 fruits you'd have 25 rows.
select a.fruit as 'fruit_ignoreMe' c.fruit as 'fruit_report' case when a.fruit = c.fruit then amount as numerator, a.amount as denominator from trans a, JOIN (SELECT distinct fruit, date) c on a.date = c.date
then your beast mode is sum(numerator) / sum(denominator)
use fruit_report as the filter. when you filter on "apple" you'll have a copy of EVERY row for the day, but the numerator will only be apples, and denominator will contain everything.
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
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.8K Visualize
- 2.5K Charting
- 737 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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