<?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 Load Fields only if they exist in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Load-Fields-only-if-they-exist/m-p/8840#M781888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;In Qlikview, I want to Load a table with the name of fields that I already know: field1, field2, ....&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;The table I am reading from may or may not contain on of the above fields. I want to set a predefined value (for example 0) for a field if it doesn't exist.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;Could you add some comment and tell me how can I improve my code?&lt;/P&gt;&lt;HR style="color: #d6d9dc; background-color: #d6d9dc; margin-bottom: 20px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px;" /&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;Example:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;Source table&lt;/STRONG&gt;:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/Z3bd7.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="Source table" class="jive-image" src="https://i.stack.imgur.com/Z3bd7.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;My list of fields&lt;/STRONG&gt;:&lt;/P&gt;&lt;OL style="margin: 0 0 1em 30px; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; list-style-position: initial; list-style-image: initial; color: #242729;"&gt;&lt;LI&gt;Field1&lt;/LI&gt;&lt;LI&gt;Field2&lt;/LI&gt;&lt;LI&gt;Field3&lt;/LI&gt;&lt;LI&gt;Field4&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;My desired result&lt;/STRONG&gt;:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/7Ik71.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="My desired result" class="jive-image" src="https://i.stack.imgur.com/7Ik71.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;HR style="color: #d6d9dc; background-color: #d6d9dc; margin-bottom: 20px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px;" /&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;I wrote a code for it:&lt;/P&gt;&lt;PRE style="margin: 0 0 1em; padding: 5px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: #eff0f1; color: #242729;"&gt;&lt;CODE style="font-style: inherit; font-weight: inherit; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&amp;nbsp; InlineTable: LOAD * INLINE [ Field1, Field2, OtherField1, OtherField2 1, 4, 7, 10 2, 5, 8, 11 3, 6, 9, 12 ]; SignTable: load if (FieldNumber('Field1','InlineTable')=0,0,Field1) as Field1, if (FieldNumber('Field2','InlineTable')=0,0,Field2) as Field2, if (FieldNumber('Field3','InlineTable')=0,0,Field3) as Field3 resident InlineTable; drop table InlineTable; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;but it gives an error:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/HjEd5.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="Error" class="jive-image" src="https://i.stack.imgur.com/HjEd5.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>m_torabi</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Load Fields only if they exist</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Fields-only-if-they-exist/m-p/8840#M781888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;In Qlikview, I want to Load a table with the name of fields that I already know: field1, field2, ....&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;The table I am reading from may or may not contain on of the above fields. I want to set a predefined value (for example 0) for a field if it doesn't exist.&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;Could you add some comment and tell me how can I improve my code?&lt;/P&gt;&lt;HR style="color: #d6d9dc; background-color: #d6d9dc; margin-bottom: 20px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px;" /&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;Example:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;Source table&lt;/STRONG&gt;:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/Z3bd7.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="Source table" class="jive-image" src="https://i.stack.imgur.com/Z3bd7.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;My list of fields&lt;/STRONG&gt;:&lt;/P&gt;&lt;OL style="margin: 0 0 1em 30px; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; list-style-position: initial; list-style-image: initial; color: #242729;"&gt;&lt;LI&gt;Field1&lt;/LI&gt;&lt;LI&gt;Field2&lt;/LI&gt;&lt;LI&gt;Field3&lt;/LI&gt;&lt;LI&gt;Field4&lt;/LI&gt;&lt;/OL&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;STRONG style="font-style: inherit; font-size: inherit; font-family: inherit;"&gt;My desired result&lt;/STRONG&gt;:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/7Ik71.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="My desired result" class="jive-image" src="https://i.stack.imgur.com/7Ik71.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;HR style="color: #d6d9dc; background-color: #d6d9dc; margin-bottom: 20px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 15px;" /&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;I wrote a code for it:&lt;/P&gt;&lt;PRE style="margin: 0 0 1em; padding: 5px; font-size: 13px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; background-color: #eff0f1; color: #242729;"&gt;&lt;CODE style="font-style: inherit; font-weight: inherit; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&amp;nbsp; InlineTable: LOAD * INLINE [ Field1, Field2, OtherField1, OtherField2 1, 4, 7, 10 2, 5, 8, 11 3, 6, 9, 12 ]; SignTable: load if (FieldNumber('Field1','InlineTable')=0,0,Field1) as Field1, if (FieldNumber('Field2','InlineTable')=0,0,Field2) as Field2, if (FieldNumber('Field3','InlineTable')=0,0,Field3) as Field3 resident InlineTable; drop table InlineTable; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;but it gives an error:&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 15px; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: #242729;"&gt;&lt;A href="https://i.stack.imgur.com/HjEd5.png" style="font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit; color: #0077cc;" target="_blank"&gt;&lt;IMG alt="Error" class="jive-image" src="https://i.stack.imgur.com/HjEd5.png" style="border-width: 0px; font-style: inherit; font-weight: inherit; font-size: inherit; font-family: inherit;" title="" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Fields-only-if-they-exist/m-p/8840#M781888</guid>
      <dc:creator>m_torabi</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Load Fields only if they exist</title>
      <link>https://community.qlik.com/t5/QlikView/Load-Fields-only-if-they-exist/m-p/8841#M781889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;InlineTable:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD * INLINE [&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Field1, Field2, OtherField1, OtherField2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1, 4, 7, 10&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, 5, 8, 11&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3, 6, 9, 12&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LET vField1 = if(FieldNumber('Field1','InlineTable') = 0, 0, 'Field1');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LET vField2 = if(FieldNumber('Field2','InlineTable') = 0, 0, 'Field2');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LET vField3 = if(FieldNumber('Field3','InlineTable') = 0, 0, 'Field3');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;SignTable:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;LOAD $(vField1) as Field1,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; $(vField2) as Field2,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt; $(vField3) as Field3&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Resident InlineTable;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;DROP Table InlineTable;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Mar 2018 11:30:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Load-Fields-only-if-they-exist/m-p/8841#M781889</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-03-26T11:30:41Z</dc:date>
    </item>
  </channel>
</rss>

