cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS View in S/4Hana Cloud converting date format

tuliovargas
Participant
0 Likes
3,008

Hi folks,

I am creating a custom CDS View to use in the "Custom Analytical Queries", my question is about date format, How I can convert a date from YYYY-MM-DD to DD/MM/YYYY?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

tuliovargas
Participant

The solution using calculation:

concat(concat(concat( substring(Date_Column, 7, 2) ,'/') , concat( substring(Date_Column, 5, 2), '/' )),substring(Date_Column, 1, 4))

Regards

TiagoRibeiro
Participant
0 Likes

Applied this solution and it worked perfectly. Thank you for this Tulio.

"Date_Column" should be switched by the respective Element/Attribute which takes the respective date.

Answers (1)

Answers (1)

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tulio,

According to my understanding, the date format is according to your customizing.

You can click the user icon and change the date format there.

Best Regards,
Owen

tuliovargas
Participant
0 Likes

Hi owen.liu, thank you for your answer.

Indeed there is an option to change the date format by configuration: User>> Settings>> Language & Region

However, there is no option for DD/MM/YYYYY

I was wondering if I can create a calculation using Regex. Do you know some reference that shows it?

Regards,

OwenLiu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Tulio,

I can see there is by default delivered as DD.MM.YYYY.

So you would like to have exactly with "/", right?

I'm afraid that's not supported.

Best Regards,
Owen

Neha35
Discoverer
0 Likes
Hi Owen,
Neha35
Discoverer
0 Likes
Hi Owen, I have created a CDS View with 3–4 fields related to dates (e.g., Posting Date, Journal Date, and Period Key). I want to change the default date format from DD-MM-YYYY to YYYYMM (with or without separators, e.g., / or -). Could you guide me on how to apply this customization either within the Custom CDS View creation or later in the Multi-Dimensional Analytical Cube? Thanks in advance!