cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated column using SQL function gives unregistered function error

Former Member
0 Kudos

Hello All,

I am trying to use SQL functions, esp (WEEK(date)) in a calculated column and am faced with the error

"Invalid Expression SAP DBTech JDBC [2048]: column store error : Unregistered function name : week"

The same function in an SQL statement works

Can you let me know if I am missing something?

Thanks and Regards,

Vijay

Accepted Solutions (0)

Answers (2)

Answers (2)

anindya_bose
Active Contributor
0 Kudos

Hi Vijay

This is possible.  We can use a functional called ISOWEEK to do the same.  I am not sure why this function is not listed, but it works.

However, I had to convert the date to long date format before using ISOWEEK.  You might see some difference in format based on your HANA revision .

Expression Used :

Only Week Number:

Cheers

Anindya

Former Member
0 Kudos

HI ,

i am currently facing this error. when i tried creating calculated column.

CONDITION STATEMENT

if (daysbetween("SALES_YEAR" - "EX-DATE")  > 60 and "QUANTITY" > 50  ,  "DISCOUNT" / 2)

Please help ... how to handle this. where is my issue..

even rightstr() dosent works... same error..

anindya_bose
Active Contributor
0 Kudos

Your discount/ 2 is probably not integer.  Change the type of Column as decimal.

By the way, are you trying to get Year or Discount ? 

One more thing, this thread was opened for another issue, please create a new thread for your issue.

Cheers

Anindya

Former Member
0 Kudos

You are right it was Decimal.

I am trying to calculate discount based on year and some criteria.

I tried to modify the column.

Could not execute 'alter TABLE "NEO_14XMBT3RWQ4E25NUEH199WUR5"."SALES" alter(DISCOUNT INTEGER)' in 619 ms 177 µs .

SAP DBTech JDBC: [2048]: column store error: modify attribute error:  [6923] Attribute load failed;index=NEO_14XMBT3RWQ4E25NUEH199WUR5:SALESen,attribute='<attribute unknown (id=206)>' (206)

former_member186082
Active Contributor
0 Kudos

Hi Vijay,

WEEK() function is not supported in calculated column, it is an SQL window function.


Regards,

Chandra.