I'm trying to receive todays month

Post Reply
samiamsz
Posts: 18
Joined: Wed Sep 02, 2020 3:08 pm
OLAP Product: tm1
Version: 11.3. 0.
Excel Version: 16

I'm trying to receive todays month

Post by samiamsz »

Hey , so I need to create a rolling average for the past 3 months.
I am trying to get the current month (In dimension as 'mmm YYYY' for example 'Jan 2021'
I Am Using this

Code: Select all

sCurrentMonth = ATTRS(sDim, (TIMST('\M') | (SUBST(TODAY(1), 1, 4))), 'PriorPeriod');

The

Code: Select all

(TIMST('\M') | (SUBST(TODAY(1), 1, 4)))
part of it keeps giving me an error saying invalid numeric expression. I'm not sure if its because it is really late but for some reason I cannot seem to figure out the problem!!!!!!
User avatar
Alan Kirk
Site Admin
Posts: 6606
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: I'm trying to receive todays month

Post by Alan Kirk »

samiamsz wrote: Thu Jan 07, 2021 7:24 am Hey , so I need to create a rolling average for the past 3 months.
I am trying to get the current month (In dimension as 'mmm YYYY' for example 'Jan 2021'
I Am Using this

Code: Select all

sCurrentMonth = ATTRS(sDim, (TIMST('\M') | (SUBST(TODAY(1), 1, 4))), 'PriorPeriod');

The

Code: Select all

(TIMST('\M') | (SUBST(TODAY(1), 1, 4)))
part of it keeps giving me an error saying invalid numeric expression. I'm not sure if its because it is really late but for some reason I cannot seem to figure out the problem!!!!!!
I'd go with it being late.

You are passing only one argument to TimSt(). It requires at least two, the first one being a date/time serial number as per the Reference Guide.

Code: Select all

TIMST(datetime, format, ExtendedYears)
Since that is absent, you're getting an invalid numeric expression error.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
Post Reply