Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

interactive script

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

5 Replies
dgreenberg
Luminary Alumni
Luminary Alumni

create a variable called vDate

Use an Input Box for vDate so users can change it.

Then simply use this formula:

=Today()-vDate

maheshkuttappa
Creator II
Creator II

‌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 ?

evan_kurowski
Specialist
Specialist

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


Hello anita,

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;

Not applicable
Author

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

rikrdodata
Partner - Contributor III
Partner - Contributor III

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.