Showing results for 
Search instead for 
Did you mean: 

Getting date from 0date using formula variable

Former Member
0 Kudos

Hello gurus,

I need to extract the year from 0DATE using formula variable in Bex query designer. Date is in format mm-dd-yyyy and I need yyyy. So I am giving offset start - 7 in formula variable (with replacement path on 0DATE). However I am getting garbage value. Can anyone please suggest why this is happening and what is the resolution?

Accepted Solutions (1)

Accepted Solutions (1)

Active Contributor
0 Kudos


Date is internally stored in this format 20120101 so you need to give offset start as 0 and length 4.

However if you need year for display purpose then it will be displayed as number and in the same format as well.Reason in FV unit/dimension tab we do not have year so you need to take number.

IF year is 2004 then it will be displayed as 2,004

Make sure to put date in rows otherwise replacement path will not work.



Answers (2)

Answers (2)

Active Contributor
0 Kudos

Dear somya,

Here date is coming from any input variable of 0DATE or  directly through 0DATE.

-  Why you used Formulae variable.You should have take Characteristic variable with replacement path.

The replacing with variable.

Here offset should be from 5 to 8.

Regards, Vijay

Active Contributor
0 Kudos

You must check my blog on same topic.

How to derive Calmonth, Calyear from Calday easily