Skip to Content
author's profile photo Former Member
Former Member

Creation of month based on date

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,

Calculation.PNG (12.8 kB)
cal.PNG (2.8 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Jan 06, 2016 at 07:16 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 15, 2016 at 06:04 AM

    Hello Lucas,

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

    Thanks,

    Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.