Quantcast
Channel: SCN: Message List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 8968

Re: Fiscal Week Begining and Week ending date

$
0
0

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.

Generate Time Data in SAP HANA - Part 1

 

I hope that helps.

 

BRs,

Lucas de Oliveira


Viewing all articles
Browse latest Browse all 8968

Trending Articles