in my dataflow I have a computeExpression that should add a "Date" field. That date field should always contain the first of the current month (e.g. for right now: Feb. 1st 2021).

I've tried to do it like this:

toDate(toString(now(), "yyyy-MM") + "-01")

My idea was to take the current date, get it as a String without the day (e.g. "2021-02") and convert it into a date again with a fixed day-string of "01".

However this results in a strange error message when I run the data flow:

Something went wrong while executing the Month + 1 node: Only the dataflow owner or users with the View All Data permission can download the log

Note: Month + 1 is the label for my computeExpression.

If I simplify my SAQL expression to, say:


It works just fine: I get the current date: 2021-02-03.

My question now: How can I get the first of the month in that date field?


Okay I've found the solution.

For anyone else stumbling upon this:

You need to add a time component to the expression. It's not explicitly documented but with that it works, so I've came up with that expression:

toDate(toString(now(), "yyyy-MM") + "-01 00:00:00")

Setting my date field to midnight.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.