Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
We have a requirement where the user will provide a date range as input. The database contains millions of records but based on the date range chosen by the user, the query should narrow the resultset to be brought back. We have implemented date picker to select the range. Now how do we pass these dates to the SQL query from Qlik Sense?
An example query may be,
SELECT POLICY_NUM, POLICY_HOLDER_NAME FROM POLICY WHERE ISSUE DATE BETWEEN @START_DATE and @END_DATE
This video is about Qlik View. We are using Qlik Sense.
Hello, did you find a solution for this, I have a similar use case of passing parameters to a where clause in oracle.
When you create your SQL Statement, you append to it the parameters of your WHERE clause. Or you can create a sproc, and then add those parameters to the SQL Statement
I am using the following query with input parameters. I see the values are replaced with the parameter values in the query. However when loading the data, there are no records loaded. If I replace the parameter values with actual values the data would be loaded. Please suggest if there is anything I am missing.
LIB CONNECT TO 'TEST';
Set v_gl_segment_name = 'Activity Code';
Set v_gl_segment_value = '10';
DIRECT QUERY DIMENSION
TEST.COMPANY,
TEST1.ACCOUNT,
MEASURE
SUM(TEST.AMOUNT) AS AMOUNT,
1 AS LINE_CT
FROM TEST ,
TEST1,
WHERE 1=1 AND
TEST.SEGMENT_NAME='$(v_gl_segment_name)' AND TEST1.CREDIT_CODE='$(v_gl_segment_value)'