<?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 Unknown column/field name in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007934#M342240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;number of fields &amp;amp; field names are set to change each month in source file, so how to use these fields and manipulate applying string functions on it &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jan 2016 15:02:25 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-01-04T15:02:25Z</dc:date>
    <item>
      <title>How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007928#M342234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;im fetching some columns dynamically,&amp;nbsp; where field names are set to change every month. after filtering the fields need to use a substring/mid function on the fields. tried below code but fetches distinct value &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 1 to NoOfFields('Initial')&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt; RecNo() as Key,&lt;/P&gt;&lt;P&gt;fieldvalue(fieldname(i, 'Initial'),RecNo()) as &lt;/P&gt;&lt;P&gt; resident &lt;/P&gt;&lt;P&gt; Initial;&lt;/P&gt;&lt;P&gt;next i;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 16:48:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007928#M342234</guid>
      <dc:creator />
      <dc:date>2015-12-31T16:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007929#M342235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think this &lt;A href="https://community.qlik.com/message/937599"&gt;Re: Partial rename using field name map&lt;/A&gt; will be helpful for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 18:14:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007929#M342235</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-12-31T18:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007930#M342236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When loading the Initial table create a fixed key in there, rather than using RecNo on the Resident load.&amp;nbsp; That should give you a row per value, rather than only distinct values.&amp;nbsp; For examples:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp; RecNo() as RowKey,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;FROM [ data source details ]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then use RowKey in place of RecNo in your Loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not entirely sure what you are trying to achieve though.&amp;nbsp; The way you are renaming the field you will only have two fields in the resultant record set; Key and Resident.&amp;nbsp; Is this what you are after?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just using the * will allow you to have changing field names each month.&amp;nbsp; Is it that you need to rename these to fixed field names after the event?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you can do is load the first row of the table using a transpose transformation on the table.&amp;nbsp; This will give you a list of all the column names.&amp;nbsp; You can then enumerate around this to create a field rename map (as &lt;A href="https://community.qlik.com/qlik-users/27943"&gt;Marcus_Sommer&lt;/A&gt;‌ suggests) or you can build your load statement by concatenating a string to give a statement with the correct AS allocation of fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other thing you can do (if you are loading from a spreadsheet) is to refer to the fields by their location rather than their name and rename them that way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 Jan 2016 20:21:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007930#M342236</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-01-03T20:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007931#M342237</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;there will be more than couple of fields in the initial table and field names set to change every month, but will be prefixed with "F_". tried by introducing a RowKey(Key) column but still results in distinct values for columns Fld1,Fld2...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for i = 1 to NoOfFields('Initial')&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;load &lt;/P&gt;&lt;P&gt;Key,&lt;/P&gt;&lt;P&gt;fieldvalue(fieldname($(i), 'Initial'),Key) as Fld$(i)&lt;/P&gt;&lt;P&gt;resident &lt;/P&gt;&lt;P&gt;Initial;&lt;/P&gt;&lt;P&gt;next i;&lt;/P&gt;&lt;P&gt;drop table Initial;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 12:59:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007931#M342237</guid>
      <dc:creator />
      <dc:date>2016-01-04T12:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007932#M342238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I presume you are aware that when you have a list box of any field in QlikView it will only ever show distinct values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add a table box with the Key field and each of the Fld fields do you get duplicate values?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 14:03:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007932#M342238</guid>
      <dc:creator>stevedark</dc:creator>
      <dc:date>2016-01-04T14:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007933#M342239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm not yet done with the Model, saw the distinct values from Data model itself&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 14:16:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007933#M342239</guid>
      <dc:creator />
      <dc:date>2016-01-04T14:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007934#M342240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;number of fields &amp;amp; field names are set to change each month in source file, so how to use these fields and manipulate applying string functions on it &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 15:02:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007934#M342240</guid>
      <dc:creator />
      <dc:date>2016-01-04T15:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007935#M342241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you have already those informations (old + new field-name) in one table you could simply use a mapping for this like in my above mentioned link. Here those code highlighted on the mapping and rename-statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;For i = 0 to NoOfTables() - 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;TRACE&amp;nbsp; Looking at table : $(vTableName);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;Let vTableName = TableName($(i));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; for k = 1 to NoOfFields('$(vTableName)')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; Let vFieldName = FieldName($(k),'$(vTableName)');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; if Right('$(vFieldName)',8) = '_Current' then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; Let vNewFieldName =&amp;nbsp; Left('$(vFieldName)',len('$(vFieldName)')-8) &amp;amp; '_Prior';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;FieldNameMap:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; Mapping&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; LOAD&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="text-decoration: line-through;"&gt;'$(vFieldName)' as&lt;/SPAN&gt;&lt;STRONG&gt; &lt;EM&gt;FromFieldName&lt;/EM&gt;,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; &lt;SPAN style="text-decoration: line-through;"&gt; '$(vNewFieldName)' as&lt;/SPAN&gt; &lt;STRONG&gt;&lt;EM&gt;ToFieldName&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="text-decoration: line-through;"&gt;AutoGenerate 1; &lt;/SPAN&gt;&lt;STRONG&gt;Resident Initial;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; end if;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;&amp;nbsp; NEXT&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: line-through;"&gt;Next&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RENAME Fields using FieldNameMap;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 15:40:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007935#M342241</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2016-01-04T15:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Unknown column/field name</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007936#M342242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;that's fine for renaming the fields, but before that all values are not fetched. distinct values are created on using the mentioned code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jan 2016 15:50:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Unknown-column-field-name/m-p/1007936#M342242</guid>
      <dc:creator />
      <dc:date>2016-01-04T15:50:00Z</dc:date>
    </item>
  </channel>
</rss>

