cancel
Showing results for 
Search instead for 
Did you mean: 

Creation of month based on date

Former Member
0 Kudos

Hello Experts,

I calculation view in start join I have created calculated column  "Month" to drive only month from "Date" Column.

Now I am getting out put as below

Please help me to get correct output.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

lucas_oliveira
Advisor
Advisor
0 Kudos

Hi,

According to the docs, using '5' on second argument of component would five you the minutes. You're probably looking at '2' instead:

Date Functions - SAP HANA Modeling Guide for SAP HANA Web Workbench - SAP Library

component

component(date, int)The int argument may be int the range 1..6, the values mean year, month, day, hour, minute, second, respectively. If a component is not set in the date, the component function returns a default value, 1 for the month or the day, 0 for other components. You can also apply the component function to longdate and time types.

So you're probably need to change that to component("PO_CREATION_DATE",2). Give it a try.

BRs,

Lucas de Oliveira

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Lucas,

Can you help me with syntax to get only "year & Month" from Date ?

Thanks,

Ravi

lucas_oliveira
Advisor
Advisor
0 Kudos

Hi,

Many ways of doing it. You could left("PO_CREATION_DATE", 😎 or format("PO_CREATION_DATE",'YYYYMM'). I'm not sure what you're looking for here.


BRs,

Lucas de Oliveira