If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

calculation for previous month

Started by Laynlowz, 09 Jun 2023 02:35:16 PM

Previous topic - Next topic

Laynlowz

hello

how would i do a calculation for the last month? I was thinking of doing a last 31 days which would work out if it was February 1st and I was pulling all of january, but come March 1st that would not work.
i found a formula that is very close to working but for some reason it never include May 31st when I try to pull May data. any ideas what I could change? any examples of a formula would be extremely helpful because I am still learning date filters.

[Performance and Throughput].[Event Summary Header].[Facility - Event Start Date Time] between _first_of_month(_add_months(current_date, -1)) and _add_days(_first_of_month(current_date), -1)

MFGF

Quote from: Laynlowz on 09 Jun 2023 02:35:16 PM
hello

how would i do a calculation for the last month? I was thinking of doing a last 31 days which would work out if it was February 1st and I was pulling all of january, but come March 1st that would not work.
i found a formula that is very close to working but for some reason it never include May 31st when I try to pull May data. any ideas what I could change? any examples of a formula would be extremely helpful because I am still learning date filters.

[Performance and Throughput].[Event Summary Header].[Facility - Event Start Date Time] between _first_of_month(_add_months(current_date, -1)) and _add_days(_first_of_month(current_date), -1)

Have you tried

[Performance and Throughput].[Event Summary Header].[Facility - Event Start Date Time] between _first_of_month(_add_months(current_date, -1)) and _last_of_month(_add_months(current_date, -1))

Cheers!

MF.
Meep!