cancel
Showing results for 
Search instead for 
Did you mean: 

Adding multiple calculated columns in analytic views sap hana

Former Member
0 Kudos

Hello,

I am creating analytic view in sap hana. The problem i am facing is while creating calculated column in analytic view. I want to create two calculated columns in one analytic view (not sure if it's possible). I am able to create one calculated column but when creating the second one it's taking the expression syntax of first column and joins it with the second column. For example:

First calculated column has the following expression: "table_column_name" = 'value1'

Second  calculated column has the following expression: "table_column_name" = 'value2'

Both the columns are aggregate  and are of measure type.

But when executing the analytic view it's taking the condition for the second calculated column as:

"table_column_name" = 'value1' and "table_column_name" = 'value2'

Is there any other-way to add more than one calculated column.?

Any suggestions?

Thanks,

Unnati

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182302
Active Contributor
0 Kudos

Hi There,

You can have any number of calculated columns.

Can you share the snapshots of your definitions.

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi Krishna,

Please find attached the screenshots:

http://screencast.com/t/OEkli5eC

http://screencast.com/t/BKlpex3il

Both the links have individual calculated columns but the value of the condition column is different.

DEVICE column has 2 different values i.e mobile/desktop

i want to get two columns with the total of mobile and desktop .

former_member182302
Active Contributor
0 Kudos

Didnt get what you are trying to do.

You kept Device = 'Mobile'

So if Device = 'Mobile' then what do you want to do ?

So you should keep some formula like this:

IF( "Device" = 'Mobile',TRUE_CONDITION,FALSE_CONDITION) or

IF( "Device" = 'Mobile',TRUE_CONDITION,IF( "Device" = 'Mobile',TRUE_CONDITION,FALSE_CONDITION))

Regards,

Krishna tangudu

Former Member
0 Kudos

I want to count how many records are present with the condition "DEVICE" = 'mobile' and "DEVICE" = 'desktop' respectively. Want the count of both in separate measures in same analytic view.

former_member182302
Active Contributor
0 Kudos

Hmm I don think you can do that like this. Check if you can use counters for this..

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi,

Can you please provide any example code for using two analytic views in calculation view to display data from both the analytic views.

I have created 2 analytic views with two different conditions as i stated above. They are returning the result correctly. Now i want to fetch the details from both the analytic views in one calculation view.

former_member182302
Active Contributor
0 Kudos

Hi,

1) Create a calcualtion Graphical View

2) Drag both your analytic views

3) Create a UNION Node and consume both the analytic views

Regards,

Krishna Tangudu

Former Member
0 Kudos

Is it compulsory to use aggregation? I am following the same procedure but its giving error while validation as - No measures are defined.

Also both the analytic views have some columns in common and i would like to join them and then get the response with few columns

former_member182302
Active Contributor
0 Kudos

In "Semantics" ; Do uncheck "Multidimensions Reporting"

Then it will allow you with out Measures

But you have a count right?

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi Krishna,

I can't find "Multidimensions Reporting" in "Semantics". Refer the screencast for the same.

http://screencast.com/t/5NrwCkDFM

Also is it necessary to have count?

Please refer the screencast for the result my analytic views are giving:

http://screencast.com/t/D3E2t8JMIhx

I want the final result in this form as in screencast:

http://screencast.com/t/FmYaookGCDLD

Thanks

former_member182302
Active Contributor
0 Kudos

Hi ,

You have an option "Data Category" = Cube. Change it to 'Dimension'. That will allow you to have the models without measure

Regards,

Krishna Tangudu

Former Member
0 Kudos

Hi Krishna,

I figured the solution to my problem. I have used "join" to join the two analytic views in calculation view(graphical).  Thanks for your quick responses.

former_member182302
Active Contributor
0 Kudos

Would want to know why join? and not union? is there anything i missed here?

Regards,

Krishna Tangudu

Former Member
0 Kudos

Since there were some columns that were common in both the analytic views and i wanted the result on there basis, as stated earlier. So using join was a better approach with respect to union.