Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

option for user input when reloading script

Hi,

I have the following load script and im wondering if there is a way for the user to input a date in somekind of input box which can be used for the load script?

Below is my current script and i would like the input (date in bold) to be used when a reload is required.

-----------------

LOAD [Sort Date],
'12/07/2010' - [Sort Date] as [Days Outstanding],
DATTYP_ID,
TRX_DAT,
TRX_ID AS [Transaction ID]
FROM
data\TRANSACTION_DATES.qvd
(qvd);

-----------------

It would also be nice if a button was available that upon clicking will ask the user to input a date and then commence reloading the script.

Any help would be great.

Regards

Jason

Tags (1)
1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

option for user input when reloading script

Jason,

You will need to assign the Input() value to ReportStartDate like this:

let ReportStartDate = Input('Enter Report Date (format DD/MM/YYYY', 'Input box');

And then convert the input text value to a date value in your expression like this:

LOAD Date#('$(ReportStartDate)') - [Sort Date] as [Days Outstanding], etc

-Rob

View solution in original post

6 Replies
Highlighted
Not applicable

option for user input when reloading script

I got the the input box to work but i now get the following error:

Field not found - <ReportStartDate>

My script is below

------------

let rDate=Input('Enter Report Date (format DD/MM/YYYY', 'Input box');
LOAD [Sort Date],
ReportStartDate - [Sort Date] as [Days Outstanding],
DATTYP_ID,
TRX_DAT,
TRX_ID AS [Transaction ID]
FROM data\TRANSACTION_DATES.qvd(qvd)
Where ReportStartDate=$(rDate);

-----------------

Any help would be great.

Thanks

Jason

Highlighted
Luminary
Luminary

option for user input when reloading script

Jason,

First create the variable ReportStartDate and initialize it in your script. Then you can use the variable in an input box.

Cheers,

Pablo

Highlighted
Not applicable

option for user input when reloading script

hi thanks for your advise, im not sure how to create the variable.

what should my script look like if i wanted to do this?

kind regards

jason

Highlighted
MVP & Luminary
MVP & Luminary

option for user input when reloading script

Jason,

You will need to assign the Input() value to ReportStartDate like this:

let ReportStartDate = Input('Enter Report Date (format DD/MM/YYYY', 'Input box');

And then convert the input text value to a date value in your expression like this:

LOAD Date#('$(ReportStartDate)') - [Sort Date] as [Days Outstanding], etc

-Rob

View solution in original post

Highlighted
Not applicable

option for user input when reloading script

Many thanks Rob this worked just fine.

Highlighted
Not applicable

option for user input when reloading script

Does anyone know how to add a default value to an user input box.

I have the following input box:

let ReportStartDate = Input('Enter Report Date (format DD/MM/YYYY', 'Input box');

And i want by default this to display todays date. The user has the option to change the default 'todays date' or enter a date of their own.

Regards

Jason