cancel
Showing results for 
Search instead for 
Did you mean: 

Union with constant value using CE script

Former Member
0 Kudos

Is  Union with Constant value functionality available in CE script? 

Ramana

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ramana,

You can "fake it" by using Calculated columns (CE_CALC) with constant values, but you'll lose a bit on performance and HANA won't prune those branches when filters are set against those columns.

Former Member
0 Kudos

Depending on your use case, I have had to use scalar variables in SQLScript in WHERE clauses between two select statements to achieve similar performance as branch-pruning graphical CalcViews. You'd use an input parameter rather than WHERE clause.

Example:

SELECT ..

FROM ..

WHERE :input_parameter = 'A'

UNION ALL

SELECT ..

FROM ..

WHERE :input_parameter = 'B'

Former Member
0 Kudos

Jody,

Thanks for such a quick reply. I was indeed going for this functionality to prune the branches of the union. Graphical view is an option, but as there are too many branches, it would have been easier to write the CE script.

Input parameter is not a good option for my use case. The beauty of union with constant value in a graphical view is that the filtering can be done by the end user directly on the displayed data (Ex: Analysis office) and  get the benefit of branch pruning in the union.

I hope future versions of HANA can provide this functionality in CE script.

Regards,
Ramana