on 2017 May 29 6:43 PM
Hi Experts,
I'm doing a template scenario OpenOrders from S4HANA to IBP. Basically I'm using a template to execute the key figure. One of the Join_Query mapping for KeyFigure date do have a mapping:
to_date((substr(to_char("2LIS_11_VAHDR".VDATU, 'yyyymmdd'), 1, 6) || '01'), 'yyyymmdd')
So I have these data from "2LIS_11_VAHDR".VDATU mapped to a target custom column VDATU then aggregated on the map. Time profile used in execution properties is -1
The result I have (with filters on other columns) is monthly with a date implied as '01', which is fine here. What I will try to populate in the output is weekly. basically results to day which monday on that week. Would the time profile also affect the final output to the STAGING table in IBP (target table for KF)
So for example from source with dates Nov 23 2016 to Nov 25 will result Nov 21 2016 on Query_Join. Would that be possible given on the predefined functional arguments and modifying the template mapping of VDATU?
Cheers,
R-jay
Request clarification before answering.
Hi R-Jay,
You can do this in HCI-DS using the day_in_week() function. Docu link: https://help.sap.com/viewer/dab65b1584e04026a132a06a711e3f5a/latest/en-US/576183036d6d1014b3fc9283b0...
This function will return 1 for Monday and 7 for Sunday. So if you construct a formula like:
(2LIS_11_VAHDR.VDATU - ( day_in_week( 2LIS_11_VAHDR.VDATU ) -1 ) )
This will substract 0, 1, 2, ... days depending of the day is Mon, Tue, Wed, ... etc. So effectively it will convert all your dates to the Monday of that week, so that you can aggregate on this Monday.
If you don't need the date itself, but the weeknumber, you could also consider the function week_in_year() : https://help.sap.com/viewer/dab65b1584e04026a132a06a711e3f5a/latest/en-US/576083ad6d6d1014b3fc9283b0...
Thanks,
Ben.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
66 | |
9 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.