Page 1 of 1

I'm trying to receive todays month

Posted: Thu Jan 07, 2021 7:24 am
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!!!!!!

Re: I'm trying to receive todays month

Posted: Thu Jan 07, 2021 7:37 am
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.