Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Setting Dimensions in Definition.xml

Hi,

First time attempting to use Qlikview extensions and finding it difficult with the lack of decent documentation.

I'm familiarising myself with how extensions work and have given myself the simple task of seeing how to filter data within an extension.  I'm using the extension provided with Qlikview documentation entitled 'template'

The Definition.xml looks like this:

<?xml version="1.0" encoding="utf-8"?>

<ExtensionObject Label="template" Description="base template for extension object" PageHeight="50000">

   <Dimension Label="Dimension 1" Initial="Path" TargetName="Dimension Name" />

   <Dimension Label="Dimension 2" Initial="Measure" TargetName="Dimension Name" />

   <Measurement Label="Measure 1" Initial="Sum(Measure)"/>

<Text Label="Text Box 1" Type="text" Expression="TITLE"/>

    <Text Label="Checkbox 1" Type="checkbox" Initial="" />

    <Text Label="selectBox 1" Type="select" Select="select1,select2,select3" SelectLabel="selectL1,selectL2,selectL3" Expression="selectL3"/>

    <Initiate Name="Chart.Title" value="Object Template" />

<Initiate Name="Caption.Text" Value="Object Template" />

  </ExtensionObject>

No matter what I change the Dimension 'Initial' attribute to be, such as 'STUDY' which is a dimension within my dataset, the initial dimensions within the extension when I drag it onto Qlikview Webview, are always something else.  When I change these values within the properties of the extension once it is in Qlikview, it works okay.

My question is how do I set which Dimensions I wish to see when the extension is dragged into Qlikview?

I hope I've explained myself clearly.

Thanks,

Darren.

1 Solution

Accepted Solutions
Stefan_Walther
Employee
Employee

Use the Initiate tag for dimension, too, e.g.

<Initiate Name="Chart.Dimension.0.Field" Value="Country" />

<Initiate Name="Chart.Dimension.1.Field" Value="Region" />

Regards

Stefan

View solution in original post

3 Replies
Stefan_Walther
Employee
Employee

Use the Initiate tag for dimension, too, e.g.

<Initiate Name="Chart.Dimension.0.Field" Value="Country" />

<Initiate Name="Chart.Dimension.1.Field" Value="Region" />

Regards

Stefan

justin_morley
Creator
Creator

Hi Stefan,

Thanks for the reply, I'm a colleague of Darren's continuing his investigation, and your answer worked fine up to a point - I'm looking at the next two problems:

1) My XML now contains this:

<Dimension Initial="STUDY" Label="Dimension 1" />

<Initiate Name="Chart.Dimension.0.Field" Value="STUDY" />

<Dimension Initial="GROUP_ID" Label="Dimension 2" />

<Initiate Name="Chart.Dimension.1.Field" Value="GROUP_ID" />

<Dimension Initial="THING" Label="Dimension 3" />

<Initiate Name="Chart.Dimension.2.Field" Value="THING" />

If I right-click on my new object in the Ajax client, I see 3 dimensions, labelled 1, 2 and 3, and the first is initiated to STUDY and the second to GROUP_ID.

The third dimension field however is blank, as if you can only initiate a maximum of two dimensions. Is this the case or am I doing something else wrong?

2) How do I similarly pre-populate my incoming Measurements?

<Measurement Label="Measure 1" Initial="Sum(Measure)"/>

<Initiate Name="Chart.Measurement.0.Field" Value="Avg(VALUE_NUMBER)" />

The above lines in XML don't seem to work. I can't find any documentation about how to use the QV object model as above. What exactly is "Chart" in this context? Will the API documentation help me because I can't seem to find a "Chart" object type?

Thanks very much,

Justin

justin_morley
Creator
Creator

I've answered number 2) for myself with some more investigation.

The answer is use the following term:

<Initiate Name="Chart.Expression.0.0.Definition" Value="Avg(VALUE_NUMBER)" />

which I think is a tad unintuitive.

For the record, I found this information in the SDK documentation here:

http://qlikcommunity.s3.amazonaws.com/misc/Qv11/qvproperties.htm

which has lots of other interesting information, and is linked from the main SDK page for QlikView Version 11 which is here:

http://community.qlik.com/docs/DOC-2639