Passing Literal Values to Predicate

We have a BigQuery table partitioned on date. In order to take advantage of the partition, we need to pass the literal dates (start and end) into the where clause. Passing something like fact_table.date between calendar.start_date and calendar.end_date won’t work.

Because we have a custom calendar, using a filter of type date also won’t work. “Last Month” doesn’t line up with our last month, and users typically don’t know when our months, quarters, and years start and end.

Is there a way to pass a literal value or string (date in this case). I’m sure this has to be a common problem, but my Google skills are failing me. I’ve tried several different things with parameters, filters, and liquid, but all to no avail.

Open to any and all suggestions. Thank you!

0 0 68
0 REPLIES 0
Top Labels in this Space
Top Solution Authors