Discussion Board for collaboration regarding Qlik DataMarket.
My objective is to assign a variable with start date which is equal to the date on which the report is generated.(basically it should take the system date as the start date on the day of generation)
Likewise another variable is to be assigned which is the end date that is two weeks before the start date.
I did try the following command:
Let StartDate = Input('Enter Start Date (MM/DD/YYYY)' , 'Input required'); But here I had to feed the date manually which I dont wan't. The Qlikview script should take the system date automatically.
The End Date should be set accordingly. (eg something like Let vEndDate = VStartDate - 14 days)
Can anybody please help me out? Thanks in advance!!!!
Let StartDate = date(today(), 'MM/DD/YYYY');
Let EndDate = date($(StartDate) - 14, , 'MM/DD/YYYY')
Something wrong with the syntax.
It's not working out.
The date is in the format of DD-MM-YYYY
Thanks and regards,
Then try this:
Let StartDate = date(today(), 'DD-MM-YYYY');
Let EndDate = date($(StartDate) - 14, , 'DD-MM-YYYY')
Still not working out.
It is capturing the start date perfectly as today's date 28-02-2017
but there is an error with the end date. The end date what it shows is 04-07-1894.
Can you please figure it out why is this happening.
Of course the single-quotes around the variable are missing and there are other typos like an additional comma - therefore try:
Let EndDate = date('$(StartDate)' - 14, 'DD-MM-YYYY');
may be this:
Let EndDate = date(today()- 14 ,'DD-MM-YYYY');
The problem is solved.
Thanks to you also Aar Kay for helping me out of my problem.