<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: .Net SDK getting master measures and dimensions in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1727002#M13005</link>
    <description>&lt;P&gt;There are two ways to do this. If you only want to list the expressions, then I'd say the most efficient way is to add the expression to the data of the list object used to list the measures. You can do that like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var measureList = app.GetMeasureList();
// The properties of the measure list will be updated at the end of the using clause
using (measureList.SuspendedLayout)
{
    // Add the path to the measure definition to the data set.
    measureList.Properties.MeasureListDef.Data.Set("def", "/qMeasure/qDef");
}

foreach (var data in measureList.Layout.MeasureList.Items.Select(item =&amp;gt; item.Data))
{
    // The measure definition is now accessible through the property "def".
    Console.WriteLine(data.Title + " : " + data.Get&amp;lt;string&amp;gt;("def"));
}&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 11 Jul 2020 08:51:57 GMT</pubDate>
    <dc:creator>Øystein_Kolsrud</dc:creator>
    <dc:date>2020-07-11T08:51:57Z</dc:date>
    <item>
      <title>.Net SDK getting master measures and dimensions</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1726355#M12998</link>
      <description>&lt;P&gt;Is it possible to get master measure expression? And also is it possible to update it programatically?&lt;/P&gt;&lt;P&gt;I'm attempting to create a small .net desktop application that connects to personal edition and downloads in a csv the master dimensions and master measures. Then edit the csv and upload it again applying the changes.&lt;/P&gt;&lt;P&gt;For now on I have this piece of code. I'm getting the measure title correctly but i cannot see how to get the measure expression neither know if is it possible to update it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;IEnumerable apps = location.GetAppIdentifiers();&lt;BR /&gt;foreach (IAppIdentifier appid in apps)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (appid.AppId == app_id)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IApp app = location.App(appid);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Qlik.Sense.Client.IMeasureList measures = AppExtensions.GetMeasureList(app);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnumerable items = measures.Layout.As().MeasureList.Items;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach (MeasureObjectViewListContainer measure in items)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string measureName = measure.Data.Title;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;}&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:56:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1726355#M12998</guid>
      <dc:creator>arngue</dc:creator>
      <dc:date>2024-11-16T01:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: .Net SDK getting master measures and dimensions</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1727002#M13005</link>
      <description>&lt;P&gt;There are two ways to do this. If you only want to list the expressions, then I'd say the most efficient way is to add the expression to the data of the list object used to list the measures. You can do that like this:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var measureList = app.GetMeasureList();
// The properties of the measure list will be updated at the end of the using clause
using (measureList.SuspendedLayout)
{
    // Add the path to the measure definition to the data set.
    measureList.Properties.MeasureListDef.Data.Set("def", "/qMeasure/qDef");
}

foreach (var data in measureList.Layout.MeasureList.Items.Select(item =&amp;gt; item.Data))
{
    // The measure definition is now accessible through the property "def".
    Console.WriteLine(data.Title + " : " + data.Get&amp;lt;string&amp;gt;("def"));
}&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Jul 2020 08:51:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1727002#M13005</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2020-07-11T08:51:57Z</dc:date>
    </item>
    <item>
      <title>Re: .Net SDK getting master measures and dimensions</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1727005#M13006</link>
      <description>&lt;P&gt;The second way to do this is to open the measure and look directly in the properties. This is also the way you would need to go if you want to modify the measure. This code shows how to set the definition of the first measure:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var measureList = app.GetMeasureList();
var data = measureList.Layout.MeasureList.Items.First();
app.DestroyGenericSessionObject(measureList.Id);
var measure = app.GetMeasure(data.Info.Id);
using (measure.SuspendedLayout)
{
    Console.WriteLine(measure.Properties.MetaDef.Title + " : " + measure.Properties.Measure.Def);
    measure.Properties.Measure.Def = "Sum(Sales)";
}
Console.WriteLine(measure.Properties.MetaDef.Title + " : " + measure.Properties.Measure.Def);&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 11 Jul 2020 09:01:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1727005#M13006</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2020-07-11T09:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: .Net SDK getting master measures and dimensions</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1731696#M13064</link>
      <description>&lt;P&gt;A running example of how to use lists to access measure information can now be found here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/AptkQlik/PublicExamples/tree/master/Lists" target="_blank"&gt;https://github.com/AptkQlik/PublicExamples/tree/master/Lists&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 09:47:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1731696#M13064</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2020-07-29T09:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: .Net SDK getting master measures and dimensions</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1759041#M13493</link>
      <description>&lt;P&gt;Hi Yko&lt;/P&gt;&lt;P&gt;Your example is very useful, thanks.&lt;/P&gt;&lt;P&gt;I'm trying to export LabelExpression from master Items but, if the label contains a formula (for example ='Year ' &amp;amp; sCurrent_Year , the result is, for example&amp;nbsp; Year 2020.&lt;/P&gt;&lt;P&gt;Is there a method to retrieve the formula instead the result ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2020 17:52:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Net-SDK-getting-master-measures-and-dimensions/m-p/1759041#M13493</guid>
      <dc:creator>MCastoro</dc:creator>
      <dc:date>2020-11-05T17:52:13Z</dc:date>
    </item>
  </channel>
</rss>

