<?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: Table column names in Qlik App in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971343#M80138</link>
    <description>&lt;P&gt;Thanks, I used your solution and it worked! I first had to rename my&amp;nbsp;&lt;SPAN&gt;FIELD_NAMES columns to ColName &amp;amp; ColNum, because "Field" and "FieldNum" seems to be reserved words. But after that, I changed the table label to:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=Only({&amp;lt;ColNum={4}&amp;gt;}ColName).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That worked! Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Aug 2022 14:02:41 GMT</pubDate>
    <dc:creator>faandebruyn</dc:creator>
    <dc:date>2022-08-22T14:02:41Z</dc:date>
    <item>
      <title>Table column names in Qlik App</title>
      <link>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971263#M80127</link>
      <description>&lt;P&gt;Hallo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have an application that visualize a table [KPIS]. The table has a few columns - KPIID, KPINAME, KPIDESCIPTION, "Jul 2021", "Aug 2021" .. "Jul 2022". This application is the base for an Excel Nprinting report, where the table image are attached as an Excel sheet.&lt;/P&gt;
&lt;P&gt;The problem is that when the next month started, the table columns move 'on' one month - now from&amp;nbsp;KPIID, KPINAME, KPIDESCIPTION, "Aug 2021" ... "Aug 2022". Now the application has an error, because it cannot find the column "Jul 2021" in the table, so the Nprinting report fails (or rather gives a warning "&lt;SPAN&gt;WARN: error during report generation: Exceeded maximum number of retries").&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I changed my table to have columns&amp;nbsp;KPIID, KPINAME, KPIDESCIPTION, 1, 2, 3, 4 ... 13, and a second&amp;nbsp;table FIELD_NAMES, with columns "COLUMN_FIELD" &amp;amp; "COLUMN_LABEL", with the following values:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;COLUMN_FIELD, COLUMN_LABEL&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;KPIID&amp;nbsp; &amp;nbsp;1,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;KPINAME 2,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;KPI_DESCRIPTION 3,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Aug 2021 4,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sept 2021 5, etc.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I want to know how I can map my column labels in the table visualization to the COLUMN_FIELD value in FIELD_NAMES.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is the application script:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let vLastUpdateTime = QvdCreateTime('$(FUNC_DATA_DIR)/THE_DATA.qvd');&lt;/P&gt;
&lt;P&gt;[PPOEE]:&lt;BR /&gt;Load * From [$(FUNC_DATA_DIR)/THE_DATA.qvd] (qvd);&lt;/P&gt;
&lt;P&gt;[T2]:&lt;BR /&gt;Generic Load KPICODE As KPI_CODE,&lt;BR /&gt;KPIAREA As KPI_AREA,&lt;BR /&gt;KPITYPE As KPI_TYPE,&lt;BR /&gt;PRODMONTH,&lt;BR /&gt;VALUE&lt;BR /&gt;Resident PPOEE;&lt;BR /&gt;&lt;BR /&gt;Set vListOfTables = ;&lt;/P&gt;
&lt;P&gt;For vTableNo = 0 To NoOfTables()&lt;BR /&gt;Let vTableName = Tablename($(vTableNo));&lt;BR /&gt;If Match(Subfield(vTableName, '.', 1), 'T2') Then&lt;BR /&gt;Let vListOfTables = vListOfTables &amp;amp; If(Len(vListOfTables) &amp;gt; 0, ',') &amp;amp; chr(39) &amp;amp; vTableName &amp;amp; chr(39);&lt;BR /&gt;End If&lt;BR /&gt;Next vTableNo&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;BR /&gt;[PPOEE_FLAT]:&lt;BR /&gt;Load KPICODE As KPI_CODE,&lt;BR /&gt;KPIAREA As KPI_AREA,&lt;BR /&gt;KPITYPE As KPI_TYPE&lt;BR /&gt;Resident PPOEE;&lt;/P&gt;
&lt;P&gt;For Each vTableName in $(vListOfTables)&lt;BR /&gt;Left Join (PPOEE_FLAT) Load * Resident [$(vTableName)];&lt;BR /&gt;Drop Table [$(vTableName)];&lt;BR /&gt;next vTableName&lt;/P&gt;
&lt;P&gt;[FIELD_NAMES]:&lt;BR /&gt;load fieldname(recno(), 'PPOEE_FLAT') as Field, RecNo() as FieldNum autogenerate nooffields('PPOEE_FLAT');&lt;/P&gt;
&lt;P&gt;Let numFieldNames = NoOfRows('FIELD_NAMES');&lt;BR /&gt;For rowIdxI = 0 To numFieldNames - 1&lt;BR /&gt;Let vField = Peek('FieldNum', $(rowIdxI), 'FIELD_NAMES');&lt;BR /&gt;Let vLabel = Peek('Field', $(rowIdxI), 'FIELD_NAMES');&lt;BR /&gt;&lt;BR /&gt;If Not Match(vLabel, 'KPI_CODE', 'KPI_AREA', 'KPI_TYPE' ) Then&lt;BR /&gt;Rename Field '$(vLabel)' to '$(vField)';&lt;BR /&gt;End If&lt;BR /&gt;Next rowIdxI&lt;/P&gt;
&lt;P&gt;Drop Table PPOEE;&lt;/P&gt;
&lt;P&gt;Below is a screenshot of my data&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="faandebruyn_0-1661168062542.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/87166i203AA8143128C405/image-size/large?v=v2&amp;amp;px=999" role="button" title="faandebruyn_0-1661168062542.png" alt="faandebruyn_0-1661168062542.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 11:36:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971263#M80127</guid>
      <dc:creator>faandebruyn</dc:creator>
      <dc:date>2022-08-22T11:36:55Z</dc:date>
    </item>
    <item>
      <title>Re: Table column names in Qlik App</title>
      <link>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971286#M80130</link>
      <description>&lt;P&gt;May be something like this for the mapping you are trying to achieve -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'$(=Only({&amp;lt;&lt;SPAN&gt;COLUMN_LABEL={1}&lt;/SPAN&gt;&amp;gt;}COLUMN_FIELD))'&lt;/P&gt;
&lt;P&gt;'$(=Only({&amp;lt;&lt;SPAN&gt;COLUMN_LABEL={2}&lt;/SPAN&gt;&amp;gt;}COLUMN_FIELD))' and so on&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 12:19:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971286#M80130</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2022-08-22T12:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: Table column names in Qlik App</title>
      <link>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971343#M80138</link>
      <description>&lt;P&gt;Thanks, I used your solution and it worked! I first had to rename my&amp;nbsp;&lt;SPAN&gt;FIELD_NAMES columns to ColName &amp;amp; ColNum, because "Field" and "FieldNum" seems to be reserved words. But after that, I changed the table label to:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;=Only({&amp;lt;ColNum={4}&amp;gt;}ColName).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That worked! Thank you very much.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Aug 2022 14:02:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Table-column-names-in-Qlik-App/m-p/1971343#M80138</guid>
      <dc:creator>faandebruyn</dc:creator>
      <dc:date>2022-08-22T14:02:41Z</dc:date>
    </item>
  </channel>
</rss>

