cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated Column issue in HANA

Former Member
0 Kudos

Hi Expert,

I am facing a issue in hana for calculated column whose datatype assigned is NVARCHAR(30),I am concatenating date at the end with other value.

After Concatenating the value is becoming more than 30 but their is no error coming while doing data preview.

e.g:

SRCDOC_ID= ORIGINALDOC_ID+SRC_TS, where ORIGINALDOCID='1831858076201021234WDevice1' and SRC_TS='20170405'

in data preview i am getting the value as SRCDOC_ID='1831858076201WDevice12017-04-05'

Please Help me about how its coming like this

Thanks

Saurabh Agarwal

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member182302
Active Contributor

This is seems to be know issue/solution where we see we define the length of the columns to be of specific length but the calculation view returns the complete value without mentioning any errors or warnings.

The issue becomes more visible, when we try to consume this view in BO or we use this in the data loading procedures where the length of the column is defined in synch with the length of the column in view . And the data loading fails due to maximum length violation error.

Would like to know if this is a known thing or if there are any enhancements coming to fix this. It would really help us a lot

Regards,
Krishna Tangudu

Former Member
0 Kudos

Hi krishna,

U are correct, while inserting through stored procedure i am getting the error while in the view no error or warning is coming.

Let me know in case u find any other thread or any fix for this issue.

Thanks

Saurabh Agarwal

santhosh_shanig
Explorer
0 Kudos

Hi,

We have also faced similar issue, it occurred only while processing huge number of records. We have realized that there is a mismatch in the result length and the length defined for the column. Only after increasing the field length, we could resolve the issue.

Regards

Santhosh

Former Member
0 Kudos

Hi Santhosh,

If i will increase the size of that field the issue will resolve. But the issue is i am not increasing than how its possible that it is accepting more than 30char?

Let me know in case u find any other thread or any fix for this issue.

Thanks

Saurabh

Former Member
0 Kudos

Hi,

The data will not be truncated in case the length you defined in the calculated column is less than the length of the data.

The data shall be properly shown to the user after calculation without any loss or error.

Thus, as in your case even though the length is 30, we see the concatenation result correctly.

Thank you.

Best Regards,

Anjali.

Former Member
0 Kudos

Hi Anjali,

As u said data will not be truncated if its more than the length of variable defined than what is the use of giving the size of variable in calculated column?

Thanks

Saurabh Agarwal

0 Kudos

In HANA date format is YYYY-MM-DD instead of YYYYMMD (as in ABAP). I assume SRC_TS is declared as DATE. In case you want result as '1831858076201WDevice120170405' instead of '1831858076201WDevice12017-04-05', try below -

SRCDOC_ID= "ORIGINALDOC_ID" + replace(string("SRC_TS"),'-','')

Former Member
0 Kudos

Hi Ashwini,

I think u didnt get the question correctly. SRC_TS i declared as date, and because of hyphen(-) only this issue is coming. Please check it and let me know the other solution.

Thanks

Saurabh Agarwal