Discussion Board for collaboration on QlikView Scripting.
Good day everyone.
I have next issue.
As Data source I have qvd file with next structure
License Plate | Start Point | Destination |
For each license plate should be created separate table Box and all table boxes should be inside one container.
I was trying to create one TableBox with all information and after inside VB script for each License plate create separate table and put this table in ContainerBox.
Unfortunately I did not found any possibility to get just part of rows from General table and Paste it into new one.
From other side I also tried to run macro from load script.
Idea was to go through all license plates inside load script and for each part of datasource call VB macro which creates a table based on that part of datasource.
but still any success
Problem is that macro did not starts from load script.
Does anyone have any idea about this question?
Regarding running macro from loadscript. It doesn't work in Publisher if you have a macro that needs system access.
Step one would be, in my opinion, to create for each License Plate a seperate table in your datamodel.
@1 as LicensePlate
for i = 0 to NoOfRows('LPList')
Let vLplate = peek('LicensePlate', $(i), 'LPList');
load * Resident Table where @1 = '$(vLplate)';
Maybe this will help you get further.
Here is a possible approach.
1. Create several Straight Table charts (not table boxes) in your container. Call them Lic1, Lic2, etc.
2. In the script assign to the unique License numbers to variables vLic1, vLic2, etc.
3. In the charts, use a calculated dim of
4. Use conditional show to hide the charts that don't have vLicN value.
You will have to pre-create the max possible charts.
Thank you Rod for the response.
Actually it might work.
What I've done is next:
1. - I created a listbox with $Table field
2. - For each item from this listbox I'm creating a separate pivot table inside VB Script
3. - And the last step should be like this - when table is being created it should be added to Container box, which was created in VB Script also. But here I met some difficulties.
Below you can see my VB Script code.
Set ContainerObj = ActiveDocument.Sheets("Main").CreateContainer
ContProp.Frame.Name.v = "Selections"
ContProp.SingleObjectMode = 1
ContProp.SingleObjectStyle = 1
ContProp.ShowObjectTypeIcons = True
set lb = ActiveDocument.GetSheetObject( "LB01" )
h = lb.GetRowCount
for RowIter=0 to h-1
rem 2. Create charts for all tables in tableModel
set chart = ActiveDocument.Activesheet.CreatePivotTable
set cp = chart.GetProperties
cp.TableProperties.IndentMode = true
cp.TableProperties.NumberOfLeftDimensions = 2
cp.GraphLayout.Frame.ObjectId = lb.GetCell(RowIter,0).Text
ContProp.ContainedObjects.Item(RowIter).Id = "Document\"&lb.GetCell(RowIter,0).Text&"]"
ContProp.ContainedObjects.Item(RowIter).Text.v = "text"
Anyway we found other way for presenting data )
Thank all of you for the help