<?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 Dynamic measure to avoid if-statements in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717635#M538136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a nested if-statement:&lt;/P&gt;&lt;P&gt;if([Category]='Events',[Events],&lt;/P&gt;&lt;P&gt;if([Category]='Delegates',[Delegates],&lt;/P&gt;&lt;P&gt;[Value]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a qlikview function to dynamically point to a measure field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen examples where you can dynamically point to a field based on a variable, however based on the row content I want to select the specific measure field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Oct 2014 17:16:37 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-13T17:16:37Z</dc:date>
    <item>
      <title>Dynamic measure to avoid if-statements</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717635#M538136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a nested if-statement:&lt;/P&gt;&lt;P&gt;if([Category]='Events',[Events],&lt;/P&gt;&lt;P&gt;if([Category]='Delegates',[Delegates],&lt;/P&gt;&lt;P&gt;[Value]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a qlikview function to dynamically point to a measure field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have seen examples where you can dynamically point to a field based on a variable, however based on the row content I want to select the specific measure field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 17:16:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717635#M538136</guid>
      <dc:creator />
      <dc:date>2014-10-13T17:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic measure to avoid if-statements</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717636#M538137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use match() and pick() like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pick(match(Category, 'Events', 'Delegates', 'Value'), Events, Delegates, Value)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you want if it doesnt match to anything, then use the Value field:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;pick(match(Category, 'Events', 'Delegates')+1, Value, Events, Delegates)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 17:46:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717636#M538137</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-10-13T17:46:01Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic measure to avoid if-statements</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717637#M538138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that makes the expression look better and I could store a number in the row to avoid the match function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I was looking for something like =sum(Field(SourceField)) where SourceField is a field in the row and based on the value in that field, QV will use the correct measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;E.g. if SourceField has the value Events, it will translate Field(SourceField) into Events, returning =sum(Events)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 18:33:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717637#M538138</guid>
      <dc:creator />
      <dc:date>2014-10-13T18:33:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic measure to avoid if-statements</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717638#M538139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, the only way I have found is using that match(pick()) combo for tables. If you were making selections on the field SourceField and wanted to get the value for the Field selected, you can do something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;sum($(=SourceField))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, like I said before, that won't work when referencing values inside the table since $() won't reference whats in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 18:52:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717638#M538139</guid>
      <dc:creator>jerem1234</dc:creator>
      <dc:date>2014-10-13T18:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic measure to avoid if-statements</title>
      <link>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717639#M538140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply, will use the pick / match&amp;nbsp; function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Oct 2014 19:14:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Dynamic-measure-to-avoid-if-statements/m-p/717639#M538140</guid>
      <dc:creator />
      <dc:date>2014-10-13T19:14:47Z</dc:date>
    </item>
  </channel>
</rss>

