cancel
Showing results for 
Search instead for 
Did you mean: 

Error in calculated column if condition in analytical view

srikanthbwbw
Active Participant
0 Kudos

Hi,

I am having issue in calculating with condition in HANA. I am creating  calculated column in which my condition is

if ("OTYPE = "ZMTS", Netvalue * 10, Netvalue * 5 )

For testing purpose I even tried if ("OTYPE = "ZMTS",50,75) but still error.

my calculated column data type is "Decimal" and column type is measure.

When i try this with key figure like if(Netvalue >1000,10,5) this works fine.

Is there any different way when we are dealing with non key figures in condition.

Thanks
Sri

Accepted Solutions (1)

Accepted Solutions (1)

RashmiAcharya
Advisor
Advisor
0 Kudos

Hi Sri,

I couldn't see "OTYPE" , "ZMTS" columns in VBRP table. On what type of columns you have created calculated column?

Also, can you click on 'Validate' button inside calculated column wizard to check syntax of the expression is correct or not?

Regards,

Rashmi

srikanthbwbw
Active Participant
0 Kudos

Hi,

Thanks for reply. When i say OTYPE its PSTYV.

Regards

Sri

RashmiAcharya
Advisor
Advisor
0 Kudos

Hi Sri,

Validation of expression is giving error as the columns used PSTYV is string data type where as ZMTS is of int data type.

Can you try using conversion functions as below?

if(("PSTYV" = string("ZMTS")),"NETWR"*5,"NETWR")

Regards,

Rashmi

srikanthbwbw
Active Participant
0 Kudos

Hi Rashmi,

Thanks for reply. I tried with the condition that you have mentioned. Its working but not as expected.

For ZMTS , column is not calculating NETWR * 5, Its just displaying value of NETWR. For others its just displaying Question mark"?".

I also  tried

if(("PSTYV" = string("ZMTS")),int("NETWR"*5),Int("NETWR")) but not luck.

Thanks

Srikanth

Former Member
0 Kudos

Hi Srikanth,

Here ZMTS is a value, not column. Try one of the below syntax it should work. (We should not use double quotes for values, it's only for columns).

if("PSTYV" = 'ZMTS',"NETWR"*5,"NETWR")


If the above one gives any syntax errors, try beow.


if(string("PSTYV") = 'ZMTS',"NETWR"*5,"NETWR")


Regards,

Venkat N.

srikanthbwbw
Active Participant
0 Kudos

Hi Guyz,

Solved. Following is the syntax

(("PSTYV" = 'ZMTS'),"NETWR" * 5,"NETWR")  

Regards

Sri    

PS: Hi Venkat....I got the solution before you posted. Thanks for your help. Assigned points. 🙂

Message was edited by: Sri BW

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In Analytic View you should use all the measures from the Single Fact table. Even this applicable to Calculated columns.

To utilize both measures from two fact tables go for Calculation View.

Thanks and Regards,

Mahesh

srikanthbwbw
Active Participant
0 Kudos

Hi,

Thanks for reply.

My analytical view is created on VBRP table there are no othr views joined to it. Is it still applicable???

Thanks

Sri

Former Member
0 Kudos

Hi,

Is this the only Fact table you are used in the view? check the condition and its properties are defined correct.

srikanthbwbw
Active Participant
0 Kudos

Hi,

YEs that the only table that i am using in my Analytical view.

Thanks

Sri