Can you pass parameters to a SQL dataset? I creat...
# gd-beginners
k
Can you pass parameters to a SQL dataset? I created a dataset that calls a Postgres function that takes a date argument. The function does multiple joins of tables which each are queried based on the date arg (to find each record whose date ranges include the point in time). There are a large # of potential combinations if we tried to pre-join all possible combinations of these tables for every point in time, otherwise I would make this into a materialized view so the query by date would be simpler. Can we set up the SQL dataset to receive a date the user chooses from a filter? This can be just a date, doesn't need to be a full timestamp. thanks
m
Hi Kurt, currently GoodData Cloud does not support parameterized SQL queries within SQL datasets. So you cannot pass user-selected parameters, like a date from a filter, into the SQL query that defines the dataset and therfore implementing a dynamic date filter that directly influences the SQL dataset’s query is not possible.
k
Ok, what would be alternative strategies for our situation: right now our SQL dataset calls a Postgres function which takes a timestamp. This function handles a series of joins, where the timestamp is a filter on which records get picked up in the various joins. Key to our use of GD is sharing reports with external partners who only get to see their own data, but the column that would be referenced by a WDF is available on only 1 of the tables that this function now joins, so if we instead build a LDM with all the relevant tables in GD, it seems we'd have to add that WDF column to every table. Do I understand this correctly? This may be possible but it feels rather heavy so I would be interested in knowing what other strategies might let us accomplish the same goals. Note that the data here represent contracts with a start / end timestamp, and the query is to find all records active at a point in time, so the query arg is not done by ranges (no Q1, or Last Week), just a single date. thanks
m
Hi Kurt, I see that you already have some ongoing communication with our Solution Engineer: David Ramirez (david.ramirez@gooddata.com) regarding this topic and you have invited them to your trial workspace to look into this issue for you. Hopefully our team will be able to assist you with this and provide you with the best solution for working with your timestamps.