cancel
Showing results for 
Search instead for 
Did you mean: 

Fiscal Week Begining and Week ending date

Former Member
0 Kudos


Hi All,

I need to convert the FISCAL weekbegining/weekending dates from my workdate(calday) in CATSDB table.  can you please provide me that any standard view available in HANA or any function to derive it.

Thank you

Accepted Solutions (0)

Answers (1)

Answers (1)

lucas_oliveira
Advisor
Advisor
0 Kudos

Hello,

I don't see information about the fiscal week on HANA generated table _SYS_BI.M_FISCAL_DIMENSION. However, that's in the main gregorian calendar table _SYS_BI.M_TIME_DIMENSION. Not sure if helps in your requirement.

If so, then you could join your CATSDB table with  your _SYS_BI.M_TIME_DIMENSION, get the calendar week refering to that date and finally, get the max and min values for dates within that same calendar week again on _SYS_BI.M_TIME_DIMENSION. Something like this:


select

  calweek,

  max(date_sql),

  min(date_sql)

from _SYS_BI.M_TIME_DIMENSION

where calweek in ( select distinct t.calweek

  from sapabap1.catsdb c

  inner join _SYS_BI.M_TIME_DIMENSION t on c.workdate = t.date_sap)

group by calweek

Results would be something like:

CALWEEKMAX(DATE_SQL)MIN(DATE_SQL)
2012402012-10-062012-09-30
2012412012-10-132012-10-07
2013212013-05-252013-05-19
2013242013-06-152013-06-09
2013262013-06-292013-06-23

There's a nice blog explaining how to generate this data on HANA.

I hope that helps.

BRs,

Lucas de Oliveira

Former Member
0 Kudos

Thank you Lucas !

Actually My requiremtn was to develop the FiscalweekBegin and FiscalweekEnding dates in my report. And I have a selection option is on weekending to push the filter on lowest level.

I cont find the way to develop the Fiscalweek from calday (workdate) from CATSDB. Above logic is good for calender week.

Is there any way to build a logic for fiscalweek? ANY INPUTS PLEASE.

Thank you

lucas_oliveira
Advisor
Advisor
0 Kudos

Hi,

Specify your requirements better and explain (with code) what you have done so far and what's missing to complete your requirement.

Without that we'd be only guessing what you need.

BRs,

Lucas de Oliveira