Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

How to calculate PreviousCalWeek (YYYYWW format) using expression editor in HANA

$
0
0

Hi Experts,

 

I need to create a calculated column in my Analytic View called PreviousCalWeek in YYYYWW format. Ex: 201401,201402....201452 etc using the HANA Forumula/Expression editior functions. The output of this column should always look at the current system date and calculate current calweek and then finally populate PreviousCalWeek in YYYYWW format.

 

So I need the above column basically to find all documents where DocumentClearingWeek = PreviousCalWeek , i.e trying to find out all docs that got cleared last week.

DocumentClearingWeek is always 6 digit (YYYYWW) derived from DocumentClearingDate (mapped that to SYS_M_TimeDimension).

 

Could you please help me with the logic for deriving PreviousCalWeek using the functions provided in HANA expression/formula editor.

There is a now() function which gives currentdate&time and weekday() function but no week() function. Please help.

 

Thanks,

KPK


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>