on 02-19-2015 10:59 AM
Hi Experts,
I am trying to do the leftstring,rightstring functions for given date to get the month and year columns.
like below,
leftstr("ZZSTUFFINGDATE",5)
but I am not getting proper results.
please suggest in this case.
Thanks.
Best Regards,
Edukondalu Konakanchi
Guys, what is up with all that string converting/cutting?
Why does nobody simply use the component () (respectively dats_component() ) function instead?
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please do read the documentation. You need to use the Year, Month and Day functions
Here's the standard doc for the Month function, you can get the rest there as well.
https://help.sap.com/saphelp_hanaone/helpdata/en/20/e544ea75191014b8209a9fc217ce0e/content.htm
Hi Ed,
Please make use of m_time_dimension table to derive it. You can find this table in sys_bi schema. join your date field to this table and derive required fields..
Cheers,
Safiyu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not getting proper result ?
You have to convert to string before using string function
for instance:
leftstr( string("ZZSTUFFINGDATE") ,3)
Hope this helps
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Move your date into a character based field, in this example we name it lv_date
If your date looks like this: 20150219
You can derive the values as follows: (Define the variables accordingly as character based)
lv_year = lv_date+0(4). - Result 2015
lv_month = lv_date+4(2). - Result 02
lv_day = lv_date+6(2) - Result 19
Then you can do with the variables whatever you like, after they've been split
Regards
Arden
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try formatting the date before using before using the leftstr.
You can also use substr function after formatting the date.
=Substr([V_DATE];3;7)
Thanks,
Shakthi Raj Natarajan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.