Hi,
I need further advise to set default values to variable (Input Box). I am new to QlikView so Please modify below query for better understanding.
V_PRM_START_DT:
LOAD
INPUT('Enter the Start Date in YYYYMMDD','Input box') AS START_DATE AUTOGENERATE 1;
LET PRM_START_DT=NUM(PEEK('START_DATE',0,'V_PRM_START_DT'));
DROP TABLE V_PRM_START_DT;
V_PRM_END_DT:
LOAD
INPUT('Enter the End Date in YYYYMMDD','Input box') AS END_DATE AUTOGENERATE 1;
LET PRM_END_DT=NUM(PEEK('END_DATE',0,'V_PRM_END_DT'));
DROP TABLE V_PRM_END_DT;
FACT_EMP_DATA:
LOAD
DATE_KEY,
EMP_KEY,
[MONTHLY SALARY AMOUNT],
[INCENTIVE AMOUNT]
FROM
FACT_EMP_DATA.QVD (qvd)
WHERE DATE_KEY>=$(PRM_START_DT) AND DATE_KEY<=$(PRM_END_DT);
Question:1
WHERE DATE_KEY BETWEEN $(PRM_START_DT) AND $(PRM_END_DT) is not working but WHERE DATE_KEY>=$(PRM_START_DT) AND DATE_KEY<=$(PRM_END_DT) is working. I would like to know why?
Is BETWEEN not valid command?
Question:2
I want to assign default values (Something like this CONVERT(VARCHAR(10),Getdate()-30,112) for Start Date and CONVERT(VARCHAR(10),Getdate(),112) for End Date) to my Input parameters so that if some one is not willing to enter these dates then it will reload with default values. How can I achieve this?
Here is link of base question: How to pass Parameters (Like SSRS) in the query of QVW files to retrieve only required data?