on 07-25-2016 5:26 PM
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 |
| 0 | |
H |
| 0 | |
I |
| 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
Hi Alejandro
Are you checking in "RAW DATA" tab or "Analysis" tab. Pull only Country and Flag objects in Analysis tab. Do you see it aggregated ? If not, share a screenshot .
Under "View Properties" of Calculation View, what is the "Data Category" ?
Regards
Anindya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Anindya Bose,
I've been researching a bit more and I have found something WEIRD...
If I build the model with a physical table in the proyection node, IT WORKS! and the result is correct:
But if I build the model with an analytical view as a source in the proyection node, it doesn't work...
Can you reproduce this issue? The Analytical view has only the physical table.
The table is this:
Any help will be appreciated, Thanks!
It seems you defined the Calculated Column in "Projection Node" . Here you are basically defining an "Attribute" type Integer, example ZIP/PIN code which should not be aggregated meaningfully .
You can define this Calculated Column either in "Aggregation" node of Calculation View or Analytic View itself and let me know if issue persists.
Regards
Anindya
User | Count |
---|---|
83 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.