• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

KPI Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • KPI Widget

    Could you look towards providing an option that allows the value to be displayed on the KPI widget to be defaulted if no records found? Currently, a dash is displayed. I would prefer to display a zero.

    Thanks.

  • #2
    You should be able to achieve that in your data source. A data set of no records is treated as null, so you could use the COALESCE function to return a different value in such cases...

    Code:
    select COALESCE(sum(tot_sales),0) as kpi_num
      from sales_file
     where year=2024 and cusno=10001

    Comment


    • #3
      That only works if I'm not filtering the data

      Comment


      • #4
        Filtering shouldn't make any difference as it doesn't alter your column in the main select.

        Can you provide screenshots of (1) your data source for the KPI widget and (2) how you're applying a filter to the widget?

        Comment


        • #5
          Here are the screens:

          datasource.png filter.png
          Attached Files

          Comment


          • #6
            Your suggestion still relies on something being returned by the SQL statement. If the filter causes nothing to be returned, then a dash is displayed.

            Comment

            Working...
            X