<?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: Subfield in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424224#M700007</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use isnull() function to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( not isnull(&lt;EM&gt;Department&lt;/EM&gt;), &lt;EM&gt;subfield(Department,'-',1), '&lt;/EM&gt;&lt;EM&gt;N/A&lt;/EM&gt;&lt;EM&gt;'&lt;/EM&gt;)&amp;nbsp; &lt;EM&gt;as Fund&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Oct 2012 16:37:41 GMT</pubDate>
    <dc:creator>jeffmartins</dc:creator>
    <dc:date>2012-10-17T16:37:41Z</dc:date>
    <item>
      <title>Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424221#M700002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a customer table holding the information for all the departments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Department:&lt;/P&gt;&lt;P&gt;ABC - 1234&lt;/P&gt;&lt;P&gt;XYZ - 1234456&lt;/P&gt;&lt;P&gt;Null&lt;/P&gt;&lt;P&gt;QVW - 98712&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am extracting the fund information from the department as:&lt;/P&gt;&lt;P&gt;SubField(Department,'-',1) as Fund&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Everything works fine here but I would like to rename Null as 'N/A' when I extract the fund information using &lt;/P&gt;&lt;P&gt;SubField(Department,'-',1) as Fund, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;H&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:21:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424221#M700002</guid>
      <dc:creator>hkg_qlik</dc:creator>
      <dc:date>2012-10-17T16:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424222#M700004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;replace(subfield(Department,'-',1),'Null','N/A') as Fund&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:25:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424222#M700004</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-10-17T16:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424223#M700005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not working. It still displays as empty field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:29:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424223#M700005</guid>
      <dc:creator>hkg_qlik</dc:creator>
      <dc:date>2012-10-17T16:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424224#M700007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use isnull() function to do this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if ( not isnull(&lt;EM&gt;Department&lt;/EM&gt;), &lt;EM&gt;subfield(Department,'-',1), '&lt;/EM&gt;&lt;EM&gt;N/A&lt;/EM&gt;&lt;EM&gt;'&lt;/EM&gt;)&amp;nbsp; &lt;EM&gt;as Fund&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424224#M700007</guid>
      <dc:creator>jeffmartins</dc:creator>
      <dc:date>2012-10-17T16:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424225#M700010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try If(Len(Department) &amp;lt;&amp;gt; 0, SubField(Department,'-',1), 'N/A') as Fund,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:38:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424225#M700010</guid>
      <dc:creator />
      <dc:date>2012-10-17T16:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Subfield</title>
      <link>https://community.qlik.com/t5/QlikView/Subfield/m-p/424226#M700015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Works fine for me IF by 'Null' you mean the string 'Null'.&amp;nbsp; So I'm betting you meant the field is actually null.&amp;nbsp; Then perhaps this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(len(subfield(Department,'-',1)),subfield(Department,'-',1),'N/A') as Fund&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a string version of the alt() function?&amp;nbsp; That would be simpler if so, but I'm not aware of one and don't see anything promising in the list of string functions.&amp;nbsp; Maybe there's some other way to simplify it, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit: I was too slow with my post, and indeed my expression was more complicated than it needed to be.&amp;nbsp; You can slightly simplify what Ducati 888 SP5 wrote, though, since 0 is false:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;if(len(Department),subfield(Department,'-',1),'N/A') as Fund&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Though I suppose that if the value of Department was '- Something', you might need my more-complicated version.&amp;nbsp; I'm guessing you don't have data like that, though.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2012 16:39:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Subfield/m-p/424226#M700015</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2012-10-17T16:39:16Z</dc:date>
    </item>
  </channel>
</rss>

