Question:
Hi everyone,
Did anyone have to create a new characteristic to get Fiscal Week?
I have the following problem:
If I create an IO with Master Data table or Text Table for FiscalWeek, and then I introduce offsets in a query, when there is Fiscal Year change in the middle, the system does the following:
W = 03.2005
W-1= 02.2005
W-2 = 01.2005
W-3 = blank
...
W-51 = 52.2004
It means that it is expecting 00.2005, 99.2004 ... etc to do a subtraction. And they not exist.
If I create an IO with Reference Characteristic 0CALWEEK, subtraction works ... but my issue is that I need 52 weeks a year, and not 53 like 0CALWEEK SID table.
I donīt know how to tell the system to do:
01.2005 - 1W = 52.2004
Did anyone have to create this kind of characteristic for reporting?
Thanks a lot for your help!!
MEG
Answer:
in stead of subtracting weeks... subtract days
you can take the first day of each week for instance, subtract 7 days and convert that one back to week
cheers,
El Belgio
PS if you're not working with a normal calendar year you have to take the fiscal year variant into account as well
Answer:
Hi,
Can do with your own piece of code but with the following check condition:
If week+4(2) = '01'.
week+4(2) = '52'.
week+0(4) = week+0(4) - 1.
else.
week - 1.
endif.
Assumed calweek in '200452' format.
Please note that calweek can also be in '522004', so change the offset accordingly in the above logic.
Hope this should solve your problem!