cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation of Financial Year Week Number in HANA based on an input date in Calculation View.

0 Kudos

Hi Folks.

As a part of Oracle to HANA migration, I have a requirement to calculate the fiscal year month number based on a given input date. Here is the expression in Oracle :

TO_CHAR(TRUNC(TABLE1.IDATU+1,'IW')+5,'YYYYIW') . I am unable to figure out equivalent expression in HANA.

Please help me on this..

0 Kudos

@Florian Pfeffer, thanks for your response. Here is thequery and screenshot for original value and calculated value. fiscal-week-nbr.png.

I am unable to see your responses for this question. When I try open the responses in my webpage, I am getting access denied pop up.

Logic applied in oracle for fiscal yearweek nbr:TRUNC(ZBWCYCLE.IDATU+1,'IW')+5,TO_CHAR(TRUNC(ZBWCYCLE.IDATU+1,'IW')+5,'YYYYIW')

Query for backtracing :

SELECT IDATU,IDATU+1,TRUNC(ZBWCYCLE.IDATU+1,'IW'),TRUNC(ZBWCYCLE.IDATU+1,'IW')+5,TO_CHAR(TRUNC(ZBWCYCLE.IDATU+1,'IW')+5,'YYYYIW') FROM TEST.

View Entire Topic
KonradZaleski
Active Contributor
0 Kudos

To get Year + ISO Week you can try following syntax:

YEAR(TABLE1."IDATU") || SUBSTR_AFTER( ISOWEEK(TABLE1."IDATU"), 'W' ) AS "YEAR_ISOWEEK"