Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
till_bentz
Contributor III
Contributor III

Set analysis in external txt file

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!

1 Solution

Accepted Solutions
till_bentz
Contributor III
Contributor III
Author

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!



View solution in original post

6 Replies
Not applicable

You may try with action, which runs (a) macro or (b) partial reload.

CELAMBARASAN
Partner - Champion
Partner - Champion

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.

till_bentz
Contributor III
Contributor III
Author

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.

Not applicable

Yes, but i understand that file may change more often than your application reloads. Is that true?

till_bentz
Contributor III
Contributor III
Author

The file itself is not changing, but the date will be set in the app and that should not trigger a reload each time...

till_bentz
Contributor III
Contributor III
Author

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!