Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

How to use "case when" in formula field

$
0
0
Hi,

I have trouble using the formula field in Pentaho Metadata Editor. I want to make a "case when". At the moment, it looks like this :
Code:

=CASE([BT_ORDER_ORDER.BC_ORDER_TYPE]="0";
"Dep";
[BT_ORDER_ORDER.BC_ORDER_TYPE]="1";
"Arr";
)

The result is :
Code:

An error occurred executing SQL: SELECT DISTINCT
          =CASE(
[BT_ORDER_ORDER.BC_ORDER_TYPE]="0";
"Dep";
[BT_ORDER_ORDER.BC_ORDER_TYPE]="1";
"Arr";
) AS "COL0"
FROM
          "myDB"."Order" "BT_ORDER_ORDER"


ERROR: syntax error at or near "="
  Position : 28

I tried without the "=" but it doesn't work. The option "is the Formula Exact?" is checked.
If one of you has already used the "case" formula, could you help me please?

Thanks.

Viewing all articles
Browse latest Browse all 16689

Trending Articles