Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I want to write a script which asks user for a date and my script shows the data from that date to the present day date? is that possible to derive the data for a particular range
create a variable called vDate
Use an Input Box for vDate so users can change it.
Then simply use this formula:
=Today()-vDate
you can set up variable and use input box to enter date in UI and use this variable in expression to filter the data based on dates.
Could you let me know why want to make changes in script ?
anita sain wrote:
Hello, I want to write a script which asks user for a date and my script shows the data from that date to the present day date? is that possible to derive the data for a particular range
If your parameter collection absolutely had to be done during script execution, you could take a look at the 'Input()' function in the manual.
Input(str cue [, str caption])
This function can be used in the script only and opens an input box that prompts the user for a value during the script execution. The parameters cue and caption are used as message and caption texts, respectively. The function returns the entered value. The input box function returns NULL if the dialog is cancelled, closed or cannot be shown.
Example:
Load
Input('Enter value', 'Input box') as v,
Recno () as r
autogenerate 3;
Let me make it very clear. I have data for every day and when i run my script, my need is that I ask user to enter a key date lets say 11/30/2015 so i should generate data from that date to present date. I am not sure how to implement it because I was going through the other discussions and they said its not possible in qlikview script.
please help.
thanks in advance
Hi Anita, I think the only way that you can control that is by set a variable as Dan says. you can set a txt file where the user can easyli edit it with date of reload. Then, in your script you can read that file with a date, put it in a variable and perform your reload with that
StartDate:
Load
Date
from Dates.txt;
let vStartDate = peek('Date',0,'StartDate');
Load
A
B
C
Fron yourDB
where Date>=$(vStartDate);
I hope it helps.
Kind Regards.
Ricardo.