Replicate DATE_TRUNC sql functionality

Hi everyone,

Is there a way to easily replicate the DATE_TRUNC SQL function? Example
I have SQL background and I have been using that formula very regularly when it comes to group by dates.

For example, if I wanted to do the date_trunc up to the month on a date column from an excel, I would have to extract year, month and days, then multiply days * -1 and add 1, then do a date diff from the original date with those days. It feels a bit indirect, but I might be wrong. Any suggestions?

Look at Time Series nodes description to pick what you need.
image

Hi there @ijoel92,

not really. The closest to it (what might help) would be Extract Date&Time Fields node.

If I got you right, for your example it would mean to extract year and month using above mentioned node and then in GroupBy node group on year and month, while for aggregation use first on your date column (together with some sum I guess). Otherwise you can share some dummy data and expected output to see what is it about.

Br,
Ivan

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.