Skip to content

How to call BigQuery functions from logica? #309

Answered by EvgSkv
GoodDingo asked this question in Q&A
Discussion options

You must be logged in to vote

Indeed, function calling was totally missing from tutorail. Updated.

Basically for functions with simple signature like FORMAT_TIMESTAMP we simply need to camel-case it, e.g. into FormatTimestamp.

So this works:

%%logica QuarterValues

MyTimestamp("2023-11-01 02:00:00+00:00", 1);
MyTimestamp("2023-11-10 09:00:00+00:00", 1);
MyTimestamp("2023-10-30 07:00:00+00:00", 2);
MyTimestamp("2023-10-20 02:00:00+00:00", 2);
MyTimestamp("2023-10-10 11:00:00+00:00", 7);
MyTimestamp("2023-10-01 05:00:00+00:00", 2);
MyTimestamp("2023-01-01 05:00:00+00:00", 11);

QuarterValues(quarter:, agg? Set= value) distinct :-
  MyTimestamp(date, value),
  quarter = FormatTimestamp("%Y-%Q", Timestamp(date));

As for d…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@GoodDingo
Comment options

Answer selected by GoodDingo
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants