Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a question regarding set analysis saved in an external txt file.
In my external file which in include using $(Include=external_setanalysis.txt); I have the following formula:
set vSADateFromDateTo = Position.Bookingdate = {'>=$(vDateFrom)<=$(vDateTo)'};
In my QlikView App I have to input fields for the date variables. The problem is, that changing these input values does not change the variable vSADateFromDateTo. I have to perform a reload to achieve this.
I guess the reason for this is, that the variable definition for vSADateFromDateTo is evaluated when a reload is performed and the variable names are replace by their current values, which would result in the following definition inside the app:
vSADateFromDateTo = Position.Bookingdate = {'>=2014.05.12<=2014.05.14'};
Is there any way to define the variables in an external file and get the changes of the input fields?
Thanks!
I found a solution:
I have to change the line
set vSADateFromDateTo = Position.Bookingdate = {'>=$(vDateFrom)<=$(vDateTo)'};
to
let vSADateFromDateTo = 'Position.Bookingdate = {">=$' & '(vDateFrom)' & '<=$' & '(vDateTo)"}';
and change all following variable definition in the same way. That way the variable names are not evaluated during reload and they can be used properly inside the app.
Thanks for all your help!
You may try with action, which runs (a) macro or (b) partial reload.
Try like this
Let vSADateFromDateTo = Replace('Position.Bookingdate = {#>=' & '$' & '(vDateFrom)<=' & '$' & '(vDateTo)#}', '#', Chr(39));
Because when it sees the $() - dollar expansion, it's evaluated by QliView and replace the result there.
Thanks, but as far as I know, macros are not a good choice if you want to reload it on a server. And also a reload would dramatically reduce the performance and responsiveness of the app.
Yes, but i understand that file may change more often than your application reloads. Is that true?
The file itself is not changing, but the date will be set in the app and that should not trigger a reload each time...
I found a solution:
I have to change the line
set vSADateFromDateTo = Position.Bookingdate = {'>=$(vDateFrom)<=$(vDateTo)'};
to
let vSADateFromDateTo = 'Position.Bookingdate = {">=$' & '(vDateFrom)' & '<=$' & '(vDateTo)"}';
and change all following variable definition in the same way. That way the variable names are not evaluated during reload and they can be used properly inside the app.
Thanks for all your help!