Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

pvintona8
New Contributor II

Specify a default expression for a Measurement in the definition.xml for an extension?

Is there a way to specify a default expression for a Measurement in the definition.xml for an extension?  I'm looking for somthing similar to the Expression attribute that is available for Text objects:

<Text Label="Show Detail?" Type="checkbox" Initial ="" Expression="1" />

<Measurement Label="My Measurement" Initial="" Expression=" ='Default Expression goes here.' "  />

I've tried to "push" a value into the expression via script.js and properties.qvpp, but can't get those methods to work either.  If somebody can help figure out this methodology instead, that would definitely be an acceptable solution too.

Thanks for the help!

1 Solution

Accepted Solutions
erik_wetterberg
Honored Contributor

Specify a default expression for a Measurement in the definition.xml for an extension?

You can use the initiate tag:

<Initiate  [Name=""] [Value=""] />

Something like:

<Initiate Name="Chart.Expression.0.0.Definition" value="Default Expression" />

Hope this helps.

Erik

Erik Wetterberg
https://extendingqlik.upper88.com/
5 Replies
erik_wetterberg
Honored Contributor

Specify a default expression for a Measurement in the definition.xml for an extension?

You can use the initiate tag:

<Initiate  [Name=""] [Value=""] />

Something like:

<Initiate Name="Chart.Expression.0.0.Definition" value="Default Expression" />

Hope this helps.

Erik

Erik Wetterberg
https://extendingqlik.upper88.com/
pvintona8
New Contributor II

Specify a default expression for a Measurement in the definition.xml for an extension?

Thanks, Erik!  Worked perfectly!

pvintona8
New Contributor II

Specify a default expression for a Measurement in the definition.xml for an extension?

Erik, any idea why I would get a "Server Error" whenever the Value attribute contains a ">" character?  Every other special character I use seems to work without a problem.  Any ideas for a workaround?

Not applicable

Re: Specify a default expression for a Measurement in the definition.xml for an extension?

You must escape some characters in xml:

"    &quot;
'
  &apos;
<
  &lt;
>
  &gt;
&
  &amp;

pvintona8
New Contributor II

Re: Specify a default expression for a Measurement in the definition.xml for an extension?

Thanks, jgeorge!  That did the trick!