question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Counter Visualization: count rows never shows zero

See original GitHub issue

Issue Summary

If I toggle Count Rows and my query returns no results, the visualization disappears. It should show “0”. It makes sense for the visualization to disappear if it points at a field and row index. But sometimes the number of rows is actually zero and this should be reflected by the counter.

Steps to Reproduce

  1. Write a query that returns a single row: SELECT 'foo', 'bar'
  2. Add a counter visualization and toggle Count Rows. The counter will show 1.
  3. Add a NULL WHERE clause to the query … where 1 =2. The counter disappears.

Technical details:

  • Redash Version: 7, 8, 9alpha
  • Browser/OS: Firefox / Chrome / Safari
  • How did you install Redash: Saas / Docker

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
arikfrcommented, Nov 22, 2019

Thank you for taking a look at this.

You need to create a fork on GitHub, push to your fork and make a pull request from there.

On Fri, Nov 22, 2019, 01:45 dmudro notifications@github.com wrote:

I wrote a fix for this including bunch of unit tests for client/app/visualizations/counter/utils.js. Am not able to push my branch and create the PR though, getting 403. Maybe @arikfr https://github.com/arikfr can advise?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/getredash/redash/issues/4265?email_source=notifications&email_token=AAAROLGQGGRL5WQOH5JVHX3QU4MTJA5CNFSM4JCGMJEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE4BIRQ#issuecomment-557323334, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAROLCLJQFNNUUWE34ZOIDQU4MTJANCNFSM4JCGMJEA .

0reactions
gabrieldutracommented, Nov 22, 2019

Hi @dmudro thanks for pointing that out, there is #4366 to allow more aggregate functions in the Counter visualization, so the “Count rows” will probably be merged into a “Counter Type” dropdown soon. Regarding the inconvenient non existent value, that seems a bug, I’ll investigate further on that as it should either show a placeholder or select a valid column value by default.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Desire to display 0's for "Count of" in table | Power BI Exchange
It shows the number of childred for each parent when the count is greater than zero but I would like to display the...
Read more >
How to get a simple count of rows in a table - Qlik Community
I'm trying to find a simple way to make my table title show the number of rows in the current selection. Usually I...
Read more >
Visual To Display Data Counts When Count Is 0
Hello! I am working on a report that displays sales rep activities for the current week. The report is being displayed on a...
Read more >
How can I count the numbers of rows that a MySQL query ...
Getting total rows in a query result... You could just iterate the result and count them. You don't say what language or client...
Read more >
Python's Counter: The Pythonic Way to Count Objects
Then you increment the counter to reflect the number of times a given object appears in the input data source. When you're counting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found