Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Jason,
First create the variable ReportStartDate and initialize it in your script. Then you can use the variable in an input box.
Cheers,
Pablo
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
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
Many thanks Rob this worked just fine.
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