## Sign up to take part

Registered users can ask their own questions, contribute to discussions, and be part of the Community!

This website uses cookies. By clicking OK, you consent to the use of cookies. Read our cookie policy.

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Registered users can ask their own questions, contribute to discussions, and be part of the Community!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Solved!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

IF THEN Formula - Alteryx to Dataiku

Good afternoon,

In Alteryx I would write a formula such as:

IF [PYMT_PAID_AMT]=0 THEN Null() ELSE [PYMT_PAID_DESC] ENDIF

I don't understand how to replicate this in Dataiku, as Dataiku recognizes that same formula as invalid, having "unknown tokens". I tried reading the documentation page, but didn't see anything helpful while scrolling through. Is there anywhere that provides examples/comparison of how to write formulas from Alteryx to Dataiku?

Operating system used: **Windows**

1 Solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi @FarSideFeb

To use a similar formula " IF Contains([ORDER_STS_DESC],"Cancelled") THEN "Cancelled" ELSE "" ENDIF" in DSS you can write something like :

You don't really need more than 3 processors here since you have the condition and if true and if false e.g Cancelled and "". If you need to perform nested ifs

if(contains(ORDER_STS_DESC, "Cancelled"), "Cancelled", "")

Below is generic example with CHERRY in the Description column, if you want to replace or create a new column you can select output column.

Let me know if that helps

Solutions shown first - Read whole discussion

3 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi,

DSS formula equivalent would be :

if(PYMT_PAID_AMT == 0, "", PYMT_PAID_DESC)

You can have a look at the documentation here : https://doc.dataiku.com/dss/latest/formula/index.html

Also very useful to when writting a formula to use the "Open Editor" panel in the Prepare recipe which will help with the syntax e.g

Let me know if that helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I did open up the editor; however, the comments it gave were not helpful. I do have one more formula question.

In Alteryx I have the formula: IF Contains([ORDER_STS_DESC],"Cancelled") THEN "Cancelled" ELSE "" ENDIF

I tried to mimick the formula example you gave above; however, that did not work as the editor only accepts 3 arguments. How would I recrate this if then formula in Dataiku?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Hi @FarSideFeb

To use a similar formula " IF Contains([ORDER_STS_DESC],"Cancelled") THEN "Cancelled" ELSE "" ENDIF" in DSS you can write something like :

You don't really need more than 3 processors here since you have the condition and if true and if false e.g Cancelled and "". If you need to perform nested ifs

if(contains(ORDER_STS_DESC, "Cancelled"), "Cancelled", "")

Below is generic example with CHERRY in the Description column, if you want to replace or create a new column you can select output column.

Let me know if that helps