3 Replies Latest reply: May 31, 2013 10:51 AM by Justin Morley RSS

    Setting Dimensions in Definition.xml



      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" />



      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.





        • Re: Setting Dimensions in Definition.xml
          Stefan Walther

          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" />




            • Re: Setting Dimensions in Definition.xml
              Justin Morley

              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,