Dynamic data comparison

Hi,

I want to perform QTD, YTD without using Domo inbuilt features dynamically.

Like, I will have a dropdown for Year using dropdown chart using the Year column from dataset.

And variable selector for QTD, YTD. User may select any of the variable selector and any one year from the dropdown.

Example:
Variable Selector : QTD || Year: 2024.
Now, I want to have two beast mode calculations.

  1. For Current selected year QTD (for the current quarter)
  2. QTD for the selected year - 1.

Also, if the user selects no year from the dropdown, the default QTD (as soon as he clicks on it) should show the data for 2024 (current year).

Appreciate your inputs! Thanks in advance. :)

Best Answer

  • david_cunningham
    Answer ✓

    @LearningNinja Why do you want to avoid using the built-in date-range/grain filters provided by Domo?

    Based on your question here, I would suggest that you take the following approach.

    1. Set your default card display date range to current year in Analyzer (this will make the card default to show the current year as you requested above).

    2. Set up a beast mode that will classify records as being either in a "Complete Month" or a "Current/Future Month"

    CASE WHEN DATE(date_column) <= DATE(LAST_DAY(DATE_SUB(CURRENT_DATE(),INTERVAL 1 MONTH))) then 'Previous Completed Months' else 'Current/Future Months' END
    

    3. Use the page filter options for dates. For example, if you wanted to show the current quarter for completed months, you would select the following. You can see that this excludes June data since June is north completed.

    This will let your users select any date range that they want, while excluding rows from incomplete months.

    Regarding doing period-over-period comparisons. I would recommend reviewing this excellent video made by @MarkSnodgrass, he lays out a very flexible way to set this up.

    David Cunningham

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

Answers

  • david_cunningham
    Answer ✓

    @LearningNinja Why do you want to avoid using the built-in date-range/grain filters provided by Domo?

    Based on your question here, I would suggest that you take the following approach.

    1. Set your default card display date range to current year in Analyzer (this will make the card default to show the current year as you requested above).

    2. Set up a beast mode that will classify records as being either in a "Complete Month" or a "Current/Future Month"

    CASE WHEN DATE(date_column) <= DATE(LAST_DAY(DATE_SUB(CURRENT_DATE(),INTERVAL 1 MONTH))) then 'Previous Completed Months' else 'Current/Future Months' END
    

    3. Use the page filter options for dates. For example, if you wanted to show the current quarter for completed months, you would select the following. You can see that this excludes June data since June is north completed.

    This will let your users select any date range that they want, while excluding rows from incomplete months.

    Regarding doing period-over-period comparisons. I would recommend reviewing this excellent video made by @MarkSnodgrass, he lays out a very flexible way to set this up.

    David Cunningham

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