How to add a row number that changes dynamically in Table Card
Hello,
How can we add row number or rank in table card?
I have attached a screenshot for more clearification. I want to display the row number in table card which has to be refreshed everytime we apply filter. Can we do it using beast mode?
We cannot use sql or ETL as this rank has to refresh everytime the filter is applied
Thanks
Best Answer
-
You will need to make sure that you are sorting your table card with the same values that you include in the order by clause of this beastmode:
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman4
Answers
-
In your image, you have rank 3 listed twice. Was that a typo, or is there something more to the rank calculation than just row number?
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Thats actually a typo. It should be each row number refreshing every time we change the filter or use different sorting.
0 -
You will need to make sure that you are sorting your table card with the same values that you include in the order by clause of this beastmode:
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman4 -
What happens when there are aggregation in the columns of table chart like AVG(Salary),SUM(Age) something like that?
0 -
Just change the count to be count(distinct) instead
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
When I do count(distinct) it is saying that is not a valid formula. Below is my formula. I am counting the sales names, but against their sales and i want to sum the sales. The first is invalid, but the second is not and the second wont allow aggregation
count(distinct `SalesHost`) over (order by `NetSales` desc)
count(`SalesHost`) over (order by `NetSales` desc)
0 -
When I do count(distinct) it is saying that is not a valid formula. Below is my formula. I am counting the sales names named (SalesHost), but against their sales and I want to sum the sales. I added a beastmode to calculate the rank, but need to get rid of the duplicate sales names. The first is invalid, but the second is not and the second wont allow aggregation.
count(distinct `SalesHost`) over (order by `NetSales` desc)
count(`SalesHost`) over (order by `NetSales` desc)
0 -
@user14340 - Can you provide some sample data so that I can test it out with your schema?
I'm not sure what is causing the issue. I might try
count(`SalesHost`) over (order by sum(`NesSales`) desc)
but i'm not sure if that is valid or not.
“There is a superhero in all of us, we just need the courage to put on the cape.” -Superman0 -
Your solution worked perfectly for aggregates.
Just as a side note I found that the below formula more accurately ranked with the method I wanted.
rank() over (order by sum(`NetSales`) desc)
0
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 298 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.8K Visualize
- 2.5K Charting
- 729 Beast Mode
- 54 App Studio
- 40 Variables
- 678 Automate
- 173 Apps
- 451 APIs & Domo Developer
- 46 Workflows
- 8 DomoAI
- 34 Predict
- 14 Jupyter Workspaces
- 20 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 121 Manage
- 118 Governance & Security
- Domo Community Gallery
- 33 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive