How to erase future cumulative bar lines

Keisuke_n01
Keisuke_n01 Member
edited March 2023 in Scheduled Reports

We want to erase the future cumulative bar line in the "Line Bar" graph, as shown in the image.

Could you please tell us how to achieve this ?


Best Answer

  • MarkSnodgrass
    Answer ✓

    You could control this by creating a beast mode for your bar values where it checks to see if the date is beyond today and make it zero or blank if it is, otherwise use the value. Something like this:

    CASE WHEN `Date` < CURRENT_DATE() THEN `barvaluefield`
     ELSE ''
     END
    

    Hope this helps.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.

Answers

  • MarkSnodgrass
    Answer ✓

    You could control this by creating a beast mode for your bar values where it checks to see if the date is beyond today and make it zero or blank if it is, otherwise use the value. Something like this:

    CASE WHEN `Date` < CURRENT_DATE() THEN `barvaluefield`
     ELSE ''
     END
    

    Hope this helps.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Thank you for answering!

    We have successfully eliminated the future cumulative bar graph with the script you gave us for a simple graph with one series.

    However, it did not work for multiple series.

    We would like to know how to solve the problem when the "Number of Running Total Lines" and "Number of Running Total Bars" are set up with more than one as shown in the figure.

    Thank you in advance.


  • If you want to prevent all lines and bar from showing future dates, you can create a similar beast mode and add it to your filters like this:

    1. CASE WHEN `Date` < CURRENT_DATE() THEN 'Historical'
    2.  ELSE 'Future'
    3.  END

    Drag this beast mode into your filters and filter to Historical. This will keep your chart from showing any future data.

    If you want some metrics to show future and not others, then you would need to create a beast mode for each metric like the one I first gave you. If you have 12 out of 15 fields, for example, that you don't want to show future values for, you would need to create 12 different beast modes.

    Hope that helps.

    **Check out my Domo Tips & Tricks Videos

    **Make sure to <3 any users posts that helped you.
    **Please mark as accepted the ones who solved your issue.
  • Thank you for answering!

    I'll give it a try!

  • MarkSnodgrass

    Please let me know if you can help.

    I have previously received the following script, but it did not work when I wanted to display by weeks.

    Can you please tell me what script to use to display the week by week?

    1. CASE WHEN `Date` < CURRENT_DATE() THEN `barvaluefield`
    2.  ELSE ''
    3.  END