Skip to Content
avatar image
Former Member

Are there any limitations on concatenating string columns in Analytic Views?

Hello Experts,

I have made the following observation and I wonder if I'm missing something or if there is a limitation in the way string columns can be combined as Calculated Columns within Analytic Views.

I created an analytic view solely with the aid of the visual editor. All columns used in the view are defined as string data types of which the row count is used on one of them to define it as a measure column. This works fine as I get the expected results from the view. Now if I create a calculated column by combining two columns (neither is the one I use as a measure) using the + operator, the validation fails with the error that the data type of measure column has to be numeric. This was acceptable previously but now that I have introduced a concatenated column (of two string columns), I get a failure on the validation step. Here is a snippet of the error:

 

Error Message

Internal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Create Scenario: failed aCalcEngine.createScenario(): The following errors occured: Inconsistent calculation model (34011)nDetails (Errors):n- CalculationNode (dataSource) -> attributes -> attribute (COUNTER): Keyfigure has to be numeric.n- CalculationNode (finalAggregation) -> attributes -> attribute (COUNTER): Keyfigure has to be numeric

So I removed the column I used as a measure and introduced a measure column from the base table which is defined as a numeric column and bingo the view works with concatenated columns as expected. I then re-introduced the previous column as a second measure and the validation step fails again with the same error.

From this it appears that you must have only numeric measure columns from the base table for you to create any concatenated string column (as a Calculated Column). Since this is fairly straight forward to implement in a raw sql, I think this is perhaps an issue with the studio unless I have missed a step somewhere.

(Searching thro the various posts, I am led to believe that I can indeed use the + operator for concat operation on string columns).

I'm on CloudShare with:

SAP HANA Studio

Version: 1.0.48

Build id: 201301130825 (372847)

HDB version info:

version: 1.00.48.372797

Any thoughts?

Regards,

Ramesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 25, 2013 at 11:23 AM

    Hi Ramesh,

    I don't think there should be an issue. I tried the same (on revision 52), that is, joining two varchar columns in Attrib View using + operator and it works fine for me. The calculated column is defined as ATTRIBUTE and not MEASURE.

    Can you please post a screenshot of your Calculated attribute to understand the issue better.

    Regards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Ravindra Channe

      Hello Ravi,

      I had experimented with both of the above before posting this question and I mention one of them in my original post:

      "So I removed the column I used as a measure and introduced a measure column from the base table which is defined as a numeric column and bingo the view works with concatenated columns as expected. I then re-introduced the previous column as a second measure and the validation step fails again with the same error."

      I therefore concluded:

      "From this it appears that you must have only numeric measure columns from the base table for you to create any concatenated string column (as a Calculated Column). Since this is fairly straight forward to implement in a raw sql, I think this is perhaps an issue with the studio unless I have missed a step somewhere."

      Now I am getting the same validation errors in other places where I am using row counts. For example, I couldn't graphically design a calculation view based on two existing views both of which have row count (as measure) and work fine on their own. When I combine these views as a union, validation complains about the columns where row counts have been used (the measures) and yet it compiles these views individually without any errors and produces the desired results! My workaround then was to hand crank the calculation view but I think the graphic designer should cope with such a scenario. It looks like the treatment of row count is inconsistent across different views.

      Kind regards,

      Ramesh