How to Capture Previous Month Data After on the 1st of Following Month

Options

I am looking for assistance to create the correct beast mode calculation based on the following:

Your assistance is greatly appreciated!

Best Answer

  • MarkSnodgrass
    Answer ✓
    Options

    @elvira_bannon slight correction to my initial beast mode. The first line needs to change so that we are just looking to see if the current date is the first day of the month.

    CASE when DAY(CURRENT_DATE()) = 1 THEN
    CASE when MONTH(startdate) = MONTH(CURRENT_DATE()) then 'Exclude'
    ELSE 'Include'
    END
    when MONTH(startdate) = MONTH(CURRENT_DATE()) then 'Include'
    ELSE 'Exclude'
    END

    **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

  • Here is what I suggest you do.

    Change your date range from Month to Date to Last 2 Months. This will bring in the current month and the previous month data.

    Next, create a beast mode that looks like this:

    CASE when DAY(gldate) = DAY(CURRENT_DATE()) and MONTH(gldate) = MONTH(CURRENT_DATE()) THEN
    CASE when MONTH(gldate) = MONTH(CURRENT_DATE()) then 'Exclude'
    ELSE 'Include'
    END
    when MONTH(gldate) = MONTH(CURRENT_DATE()) then 'Include'
    ELSE 'Exclude'
    END

    Drag this beast mode into your filters and filter to Include.

    This will will check when it is the 1st of the current month and exclude any data in the current month and include the previous month. If it isn't the 1st of the current month it will include the data from the current month and exclude the everything else.

    **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.
  • MarkSnodgrass
    Answer ✓
    Options

    @elvira_bannon slight correction to my initial beast mode. The first line needs to change so that we are just looking to see if the current date is the first day of the month.

    CASE when DAY(CURRENT_DATE()) = 1 THEN
    CASE when MONTH(startdate) = MONTH(CURRENT_DATE()) then 'Exclude'
    ELSE 'Include'
    END
    when MONTH(startdate) = MONTH(CURRENT_DATE()) then 'Include'
    ELSE 'Exclude'
    END

    **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.
  • pauljames
    pauljames Contributor
    Options

    @elvira_bannon Would changing filter view to 'previous month' suffice?

    IF I SOLVED YOUR PROBLEM, PLEASE "ACCEPT" MY ANSWER AS A SOLUTION. THANK YOU!

  • elvira_bannon
    Options

    Thank you very much Mark Snodgrass.

    The second formula you provided works as needed.

    You are awesome!

  • elvira_bannon
    Options

    I would like additional assistance regarding the beast mode provided by Mark. It worked for the first day of the month. However, it does not capture data on the second day of the month, which is current month. Do you have additional recommendations for the formula to work past the first of the month? Thank you!

  • elvira_bannon
    Options

    Please disregard my previous message. It appears that the problem has to do with the DataSets not updating.