cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with string value in the formula

Former Member
0 Kudos

Hi.

In the query I want to write the following expression for formula:

(var == 01) * 5 + (var == ZNTR) * 10

where var is formula variable.

System doesn't allow to write the second part of logical expression because var should accept only numeric values.

How to solve this problem?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Try customer exit for formula variables and populate them with ZINT and VAR as replacement path of the char you want to compare which may help as both of them are in same type.

Thanks,

Arun

Former Member
0 Kudos

Hi,

It is not possible to enter a char value in a formula of the query.

Create a KF say Flag, populate this KF at the ETL logic being if the value is ZNTR then flag = 1 else flag = 0.

In the Query, you can give the condition as (flag==1)*the value you want to display.

Hope it helps.

Krishna

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Lets assume you have bulilt a formula variable on characterstic CHAR1

1 ) Create a CKF witch is equla to "1".

2) Create a RKF with Key figure is above CKF and restriction on CHAR1 = ZNTR

3) Now take the above RKF into columns area and hide it. Lets say this is "column1"

4) Now create aboolean function as below:

(var == 01) * 5 + (column1) * 10

Regards,

Anil Kumar Sharma .P

former_member204514
Contributor
0 Kudos

Marat,

If you are sure that var contains only two values then simply write formula basedon the var numeric value,

i.e (var == 01) * 5 + (var <> 01) * 10

Note: this can be applied only if the var values have two possible values.

Hope this helps,

Regrds,

anil