<?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 Test for omitted field in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Test-for-omitted-field-in-expression/m-p/176018#M712018</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found the solution myself. The following expression works and is a lot cleaner:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=if(index(concat($Field, '|'), 'My measure') &amp;gt; 0, SUM([My measure]))&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Mar 2011 12:09:19 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-25T12:09:19Z</dc:date>
    <item>
      <title>Test for omitted field in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Test-for-omitted-field-in-expression/m-p/176017#M712017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have certain users that are not allowed to see a field from my fact table. I have used the OMIT field in section access to omit this field from the fact when the user opens the QlikView document. This works excellent.&lt;/P&gt;&lt;P&gt;My problem is in a chart that I am showing. One of the expressions in the chart uses the omitted field. Even when the field is omitted it still shows the measure in the legend. I want to get rid of the measure in the legend when the field is not present in the fact.&lt;/P&gt;&lt;P&gt;Let's assume that the measure that can be omitted is named &lt;I&gt;[My measure]&lt;/I&gt;. The chart shows the sum of that measure: &lt;I&gt;SUM([My measure])&lt;/I&gt;. Right now I use the following expression to hide the chart-expression when it is not present in the fact:&lt;/P&gt;&lt;P&gt;&lt;I&gt;=If(Not IsNull(Min([My measure])), SUM([My measure])))&lt;/I&gt;&lt;/P&gt;&lt;P&gt;This will hide the measure from the chart when &lt;I&gt;[My measure]&lt;/I&gt; is omitted, but it will also hide the measure when it has no data. Furthermore I don't really feel that this is the right way to do this.&lt;/P&gt;&lt;P&gt;I have looked at the function FieldNumber, but this only works when you are in script.&lt;/P&gt;&lt;P&gt;Does anyone know a way to check for the existence of a field in an expression? Or is there another way to solve the problem of omitting measures?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 10:42:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Test-for-omitted-field-in-expression/m-p/176017#M712017</guid>
      <dc:creator />
      <dc:date>2011-03-23T10:42:57Z</dc:date>
    </item>
    <item>
      <title>Test for omitted field in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Test-for-omitted-field-in-expression/m-p/176018#M712018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have found the solution myself. The following expression works and is a lot cleaner:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;=if(index(concat($Field, '|'), 'My measure') &amp;gt; 0, SUM([My measure]))&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 12:09:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Test-for-omitted-field-in-expression/m-p/176018#M712018</guid>
      <dc:creator />
      <dc:date>2011-03-25T12:09:19Z</dc:date>
    </item>
  </channel>
</rss>

