<?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: How to use Null() into a set analysis expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754040#M268626</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish the easiest solution (HOTEL_AREA-={'*'}) had worked but it doesn't , I do not know why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The solution "SUM({&amp;lt;REAL_PERIODO_USD&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;={'=Len(Trim(&lt;SPAN style="color: #3d3d3d;"&gt;HOTEL_AREA))=0&lt;/SPAN&gt;'} " &lt;/STRONG&gt;works ok, but I don't understand why, I do not understand its logic but is usefull in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because I have other fields with null vaues, I wonder if there is a syntanxis in script to replace all the "len(trim('any_field))=0" by ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if(len(trim(*))=0 , '' , * ) as *&lt;/P&gt;&lt;P&gt;from ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 03 Nov 2014 11:16:36 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-11-03T11:16:36Z</dc:date>
    <item>
      <title>How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754035#M268621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi , I have this set analysis expression but the values in 'HOTEL_AREA' are Null() so the expression is not filtering as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How could I write correctly the set analysis expression to consider empty or Null() values instead of {''}?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-SUM({&amp;lt;HOTEL_AREA&lt;STRONG style="color: #ff0000;"&gt;={''},&lt;/STRONG&gt;TIPO_EMPRESA={'HOTEL'}&amp;gt;}REAL_PERIODO_USD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:27:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754035#M268621</guid>
      <dc:creator />
      <dc:date>2014-11-03T10:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754036#M268622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot manage directly null values in set analysis but you can use '*' to set all as you 've done, there is another option, if your &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;HOTEL_AREA field is used as dimension you can exclude nul values by checking the box in the dimension page.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:31:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754036#M268622</guid>
      <dc:creator>alexandros17</dc:creator>
      <dc:date>2014-11-03T10:31:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754037#M268623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try using &lt;STRONG&gt;-={'*'}&lt;/STRONG&gt;. A better solution is to replace the nulls in the script with real values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:32:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754037#M268623</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-03T10:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754038#M268624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SUM({&amp;lt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;REAL_PERIODO_USD&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;={'=Len(Trim(&lt;SPAN style="font-weight: inherit; font-style: inherit; color: #3d3d3d;"&gt;HOTEL_AREA))=0&lt;/SPAN&gt;'},&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;TIPO_EMPRESA={'HOTEL'}&amp;gt;}REAL_PERIODO_USD)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:43:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754038#M268624</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-11-03T10:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754039#M268625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Create one more field in the script just below the HOTEL_AREA&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(IsNull(HOTEL_AREA) or LEN(TRIM(HOTEL_AREA))=0, 1, 0) as HOTEL_AREA_NULL_FLAG&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now use as below&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;TIPO_EMPRESA = {'HOTEL'}, HOTEL_AREA_NULL_FLAG&amp;nbsp; = {'1'}&amp;gt;}REAL_PERIODO_USD)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 10:59:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754039#M268625</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-11-03T10:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754040#M268626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I wish the easiest solution (HOTEL_AREA-={'*'}) had worked but it doesn't , I do not know why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;The solution "SUM({&amp;lt;REAL_PERIODO_USD&lt;/SPAN&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;={'=Len(Trim(&lt;SPAN style="color: #3d3d3d;"&gt;HOTEL_AREA))=0&lt;/SPAN&gt;'} " &lt;/STRONG&gt;works ok, but I don't understand why, I do not understand its logic but is usefull in this case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because I have other fields with null vaues, I wonder if there is a syntanxis in script to replace all the "len(trim('any_field))=0" by ''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;/P&gt;&lt;P&gt;load&lt;/P&gt;&lt;P&gt;if(len(trim(*))=0 , '' , * ) as *&lt;/P&gt;&lt;P&gt;from ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 11:16:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754040#M268626</guid>
      <dc:creator />
      <dc:date>2014-11-03T11:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754041#M268627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="Code"&gt;You replace nulls in fields in the script by adding these two lines at the start of the script:&lt;/P&gt;&lt;P class="Code"&gt;&lt;/P&gt;&lt;P class="Code"&gt;NullAsValue *;&lt;/P&gt;&lt;P&gt;Set NullValue = 'NULL' ;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 11:21:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754041#M268627</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2014-11-03T11:21:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754042#M268628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u are using "HOTEL_AREA" as dimension ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;just use "supress null values"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 11:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754042#M268628</guid>
      <dc:creator />
      <dc:date>2014-11-03T11:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to use Null() into a set analysis expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754043#M268629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;SUM({&amp;lt;REAL_PERIODO_USD&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG&gt;={'=Len(Trim(&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #3d3d3d;"&gt;HOTEL_AREA))=0&lt;/SPAN&gt;'} --&lt;/STRONG&gt;&lt;/SPAN&gt;You will get correct result only when &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;REAL_PERIODO_USD is unique across the rows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create ID using RowNo() in script and try this&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;ID={'=Len(Trim(HOTEL_AREA))=0'},TIPO_EMPRESA={'HOTEL'}&amp;gt;}REAL_PERIODO_USD)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Create flag in script as below and use that in Set Analysis&lt;/P&gt;&lt;P&gt;Len(Trim(HOTEL_AREA)) As HOTEL_AREA_NULL_FLAG&lt;/P&gt;&lt;P&gt;=SUM({&amp;lt;HOTEL_AREA_NULL_FLAG={0},TIPO_EMPRESA={'HOTEL'}&amp;gt;}REAL_PERIODO_USD)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Nov 2014 13:58:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Null-into-a-set-analysis-expression/m-p/754043#M268629</guid>
      <dc:creator>anbu1984</dc:creator>
      <dc:date>2014-11-03T13:58:25Z</dc:date>
    </item>
  </channel>
</rss>

