Discussion Board for collaboration on QlikView Scripting.
I am currently loading various qvds based on their date. the user can type into an input box the values which they wish to load. I want to change this to just selecting from a listbox instead of having to manually type the dates in?
I tried putting the variable as concat(Date, ',') but the function cannot be used in the script.
Has anyone ideas?
Just to clarify - I want to enable the user to select in a list box which dates they want to reload the data for?
Solved! Go to Solution.
Don't write your expression in variable "vABC" just leave it empty.
Consider your LoadedDate field is "CreatedDate"
Go to Document properties --> Triggers --> FieldEventTriggers
And selecte the field "CreatedDate" and Click On Select Add Action --> External --> Set Variable --> Variable = vABC and Value = if(getselectedcount(ABC)>0, concat(getfieldselections(ABC), ','), getfieldselections(ABC)).
Hope now you will get the solution.
I did something similar hope it helps;
My application takes start and end date and puts them into a for loop and to create a inline calendar which is stored in calendar.qvd.
Then you can create your calendar table and put your date field into listbox so users can select what theyn wish...
Brief example is below
let nextperiod= V_Calendar_Start;
For int_nextperiod =int_V_Calendar_Start to int_V_Calendar_End
LOAD * INLINE [ID, EFFECTIVE_START_DATE, YEAR,MONTH,Composite
nextperiod= addmonths (nextperiod,1);
store Calendar into QVD\Calendar.qvd (qvd);
I have a loop created and a list of dates, eg 201202, 201203, 201204 etc.
My qvds are names 201202.qvd, 201203.qvd etc.
My issue is how do i translate my selections in this listbox into the dates on which I should perform my loop.
eg. I select 2 dates in my list box 201202 and 201203, my loop should then only reload the 201202 and 201203 qvds?
Firstly I would find how many values are selected in your list box by using GetSelectedCount(Your_Field Name)
Then put this number in to a foor loop
get the selections on your list box by using GetFieldSelections(Your_field_name) into a variable ( Var_qvd) then
Hope it helps...
The issue for this is that when the variable is created the script does not recognise the getfieldselections function? this may work on a text box on the front end but when coming to a load it simply gives tries to load from:
abc.getfieldselections(fieldname).qvd which obviously does not exist!
vABC variable will holds the values selected in the field values of "A" after clicking on the button .
vSample variable will holds the values of vABC values.
i.e; if vABC holds like 201202,201203 then vSample in first for loop holds 201202 and in second for loop holds 201203.
I hope you understand now.