Conditionals and comparison in DataBrew

0

Can Databrew set a column afternoon to be 1 if hour>12 and hour <16 , otherwise 0 ?

This requires

  1. Numerical comparison "less than" (not string comparison)
  2. Boolean and

This actually can be done with Databrew with some arithmetic transformations and the sign function, but that gets complicated.

Does Databrew support afternoon = (hour>12 and hour <16) ?

質問済み 3年前576ビュー
3回答
0

Hi JoshuaFox,

Thank you for reaching out. Logical operations are on the roadmap (and, or, not, etc) as is richer data type support. For now there are a couple ways you could achieve your needs depending on the shape of the data in your column.

If it is presented in a String column with a timestamp format I would recommend using the Flag transformation. You could then use a custom value to flag a customer regex (something along the lines of 1\[2-6]:\[0-5]\[0-9]:\[0-5]\[0-9]), and set it to flag as 1 or 0.

If it is presented as a Number column you can use the Column filter icon on the column header, this will open up a modal with different conditions including less than and greater than. By clicking the primary Filter values button, the conditions will be added visually but not applied as a recipe step. Then you can choose to apply your next step only on the filtered values.

Best,
Romi

回答済み 3年前
profile picture
エキスパート
レビュー済み 1ヶ月前
0

Romi,

Thank you for that answer.

Are much simpler conditionals possible? Column B is "1" if an only if Column A is "999" (String or Number)? I have asked it here https://forums.aws.amazon.com/thread.jspa?threadID=339388&tstart=0

and if you can answer that I would appreciate it.

回答済み 3年前
0

Hi,

Yesterday I was able to use CASE function in aws databrew, but this function disappeared today for some reason, could you please advise what happened and when can I use CASE function again?

回答済み 3年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ