Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts
I am having the following issue,Here i am having the following variables
LET vStartYear=2013;
LET vCurrentYear=year(today());
LET vMinDate=01-01($(vCurrentYear) - $(vStartYear));
OutPut: -3
But, How we can get 01-01-2013 dynamically
Thanks
Madhu
Use:
Let vMinDate = MakeDate(vStartYear, Month(Today()), Day(Today()));
may be like:
Let vMinDate=YearStart(Today(), -3) ;
=date#(YearStart(Today(), -3) ,'dd-mm-yyyy')
Hi Jonathan dienst,
Thank you very much for your reply.
Here i am getting output like : 1/7/2013 (as mentioned above code)
But, I want as following format 01-01-2013.
How , we can achieve.
date(ur datefield,' mm-dd-yyyy') as year
Try,
Let vMinDate= Date(YearStart(Today(), -3) ,'DD-MM-YYYY')
Storing a date as a number or as a text value in a variable (variables, because of being an MS VBScript object, cannot store dual values) both have advantages in specific cases.
If
When using a date in a variable in a situation where the format does not correspond to the required format, conversions must be done. You can avoid these by choosing the best storage type in advance.
In the end, it doesn't really matter much for QlikView because you can always convert from one format to the other. But it means more work for both you and the QV engine(s).
Best,
Peter