Skip to Content
0
Former Member
Jul 25, 2016 at 04:26 PM

Sum column (flag = 1) problem

172 Views

Hello guys,

I'm facing a curious problem here with HANA. I have a simple Calculation View with only one proyection with a table as a source where I want to create a Calculation Column that will work as a flag and it will be 1 or 0 dependant of some contitions.

The problem comes when I try to sum this column because it not sums 1's it only display 1 or 0.

For example, I have this table with the FLAG_ACTIVE calculation column created:

Client Country FLAG_ACTIVE A USA 1 B USA 1 C USA 1 D USA 0 F CANADA 1 G

CANADA

0 H CANADA 0 I CANADA 1

The FLAG_ACTIVE is a INTEGER Calculated Column and in the semantic layer show a Sum as the aggregation method.

But if I try to check the results in the Data Preview, if I select Country and FLAG_ACTIVE, it gives me the following result:

COUNTRY FLAG_ACTIVE USA 1 CANADA 1

But it is wrong as USA should be 3 and CANADA 2

How can I archieve my requirement?

I have also tried to create another calculation view over this one to try to create another calculation column from the flag, but the result is the same, it doesn't aggregates, it only shows 1 or 0

Any tips?

Thank you very much