Default Message

I want a card with a single line of text. Not a table. This is to act like a caption textbox. To indicate last run. The text is to indicate most recent date within the dataset. Assume there's a column called [date].

Here's the tricky part. This date must be based on the data itself. We have many offices. When filtered to an office, this card needs to show the most recent for the filtered office. When no office is selected, I want it to show the most recent date for the dataset.

In SQL, it would be something like if count(*)=1 then XXX else ZZZ. But I don't know a Domo equivalent to COUNT(*) in a calculated field.

** Was this post helpful? Click Agree or Like below. **
** Did this solve your problem? Accept it as a solution! **

Best Answer

  • david_cunningham
    Answer ✓

    @ArborRose how about something like this. you can see we have a max date per group.

    Set the default to the max date when count > 1, else use the group max date

    None selected, defaults to overall max date

    1 selected - shows date for group

    case when COUNT(DISTINCT group) > 1 then MAX(date) else MAX(date) over (partition by group) end
    

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

Answers

  • Data_Devon
    Data_Devon Contributor

    What about using the "Textbox" chart type, and then using [date] as the Text. This would then just be a simple caption that's populated by the date field within the dataset.

    That seems too easy so I must be missing something, ArborRose.

    ✅Did this solve your problem? Accept it as a solution!

    ❤️Did you love this answer? Mark it as "Awesome"!

    👍Do you agree with this process? Click "Agree"!

  • david_cunningham
    Answer ✓

    @ArborRose how about something like this. you can see we have a max date per group.

    Set the default to the max date when count > 1, else use the group max date

    None selected, defaults to overall max date

    1 selected - shows date for group

    case when COUNT(DISTINCT group) > 1 then MAX(date) else MAX(date) over (partition by group) end
    

    David Cunningham

    ** Was this post helpful? Click Agree 😀, Like 👍️, or Awesome ❤️ below **
    ** Did this solve your problem? Accept it as a solution! ✔️**

  • Yes, the trouble is trying to get it to give a most recent based on the data it has filtered or unfiltered. And then displaying it as text (so it can be used as a caption). David's answer doesn't put it in a text box, but it provides the same result in a card.

    My question was posted last week. And I greatly appreciate y'all responding.

    My solution was to put my output on a brick and control the entire card. I did this because my rows were dissimilar. The first two rows were year comparison. The next two were calculations based the difference and the %. When filtered, the display filters the numbers to the selection and shows the most recent data available based on the data it has aggregated.

    And because its a brick, I can also control the padding. It drives me nuts to have dashboards with padding forced on me. Even in a Domo app, NIL doesn't give 0 pixel padding.

    ** Was this post helpful? Click Agree or Like below. **
    ** Did this solve your problem? Accept it as a solution! **