Discussion Board for collaboration related to Creating Analytics for QlikView.
Can I use the SQL Statement in LET statement. For example I want to calculate the minimum date from a table initialize to a variable. So that it can be used in my calender.
For example I want do some thing like the below one to that I can use vDateMin in any of the variable for MinDate in my calender.
LET vDateMin = SQL Select min(d_entry_date) from Tbl_DWR;
As per my knowledge you cant put sql query in a variable at script level but you can do it at the design / development level by defining variable in document.
Let Statement works like variable declaration and Initialization. So during that time you cant assign value from any backend tool.
This can be work for you.
We can get a value from a table, such in that example:
Currrency:LOAD * INLINE [ "X" , "XValue" usd , usdValue eur , eurValue tl , tlValue];SET vCurrency = '=Minstring("XValue")';
So if you store your result on a table, you can use its columns, and take into a variable.If we customize to your case, You can try this:
MinDate:SQL Select min(d_entry_date) As mDate from Tbl_DWR;
SET vCurrency = '=Minstring("mDate")';