<?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: Lower case all field names, not field values automatically in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035222#M85313</link>
    <description>&lt;P&gt;take a look at &lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Alias.htm#" target="_self"&gt;Alias&lt;/A&gt;. it might help you to harmonise your temp1 table field names before you do the resident load.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the following script in the beginning of your script.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Alias Name as name, Month&amp;nbsp;as month, Day as day;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Feb 2023 07:04:31 GMT</pubDate>
    <dc:creator>Vegar</dc:creator>
    <dc:date>2023-02-10T07:04:31Z</dc:date>
    <item>
      <title>Lower case all field names, not field values automatically</title>
      <link>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035206#M85310</link>
      <description>&lt;P&gt;I am creating a qvd monitoring app&lt;BR /&gt;&lt;BR /&gt;We are looping through all qvds in a directory and reviewing the date fields within the QVDs&lt;BR /&gt;&lt;BR /&gt;Some qvds have their date fields as :Year, Month, Day&lt;BR /&gt;Others have it in lower case: year, month, day&lt;BR /&gt;&lt;BR /&gt;These are the only two scenarios of field names for the date fields Im looking at&lt;BR /&gt;&lt;BR /&gt;Using the autogenerate function to get a max date generated for each qvd&lt;BR /&gt;&lt;BR /&gt;Everything is working as expected however I'm not able to get the loop to work for the different cases in the field names for different qvds&lt;BR /&gt;&lt;BR /&gt;How can I get the code to work in either case? Any way to force aliasing of&amp;nbsp; field names such that all field names themselves are lower case ? (I don't care about field values)&lt;BR /&gt;&lt;BR /&gt;sample script :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;QVDfileInfo:
LOAD
    "Directory",
    "FileName",
    "Field",
    "Refresh Frequency" as refreshSch,
    Team
Resident QVDList;

for vRow = 1 to NoOfRows('QVDfileInfo')

    Let vQvdPath    = Peek('Directory',vRow-1,'QVDfileInfo');
    Let vQvdFile    = Peek('FileName',vRow-1,'QVDfileInfo');
    Let vField      = Peek('Field',vRow-1,'QVDfileInfo');
    Let vrefreshSch = Peek('refreshSch',vRow-1,'QVDfileInfo');
    Let vTeam = Peek('Team',vRow-1,'QVDfileInfo');

	if '$(vField)' = 'Year,Month,Day' Then
		 
          temp1:
              LOAD *
              FROM [$(vQvdPath)/$(vQvdFile)](qvd);

          NoConcatenate  
          temp:
          Load Distinct
              year&amp;amp;month&amp;amp;day as Date_temp // This is where it fails if a qvd has Year/Month/Day as field names
          Resident temp1;

          Drop Table temp1;

          Let vField = 'Date_temp';

          trace('$(vField)');

          ValidationTable:
              LOAD 
                 '$(vQvdPath)' as QvdPath,
                 '$(vQvdFile)' as QvdFile,
                 '$(vrefreshSch)' as "Refresh Schedule",
                 '$(vTeam)' as Team,
              date(date#(max(FieldValue('$(vField)', recno())), 'YYYYMMDD'), 'MM-DD-YYYY') as File_Partition_Date
              AUTOGENERATE FieldValueCount('$(vField)');
              
   		 drop table temp;
    End If
Next

drop table QVDfileInfo;

exit script;
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 21:38:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035206#M85310</guid>
      <dc:creator>Panv</dc:creator>
      <dc:date>2023-02-07T21:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Lower case all field names, not field values automatically</title>
      <link>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035222#M85313</link>
      <description>&lt;P&gt;take a look at &lt;A href="https://help.qlik.com/en-US/qlikview/May2022/Subsystems/Client/Content/QV_QlikView/Scripting/ScriptRegularStatements/Alias.htm#" target="_self"&gt;Alias&lt;/A&gt;. it might help you to harmonise your temp1 table field names before you do the resident load.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add the following script in the beginning of your script.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Alias Name as name, Month&amp;nbsp;as month, Day as day;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Feb 2023 07:04:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035222#M85313</guid>
      <dc:creator>Vegar</dc:creator>
      <dc:date>2023-02-10T07:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Lower case all field names, not field values automatically</title>
      <link>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035253#M85314</link>
      <description>&lt;P&gt;Use a Mapping Table to rename the fields before loading&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Add below Mapping Load before the start of the script(&amp;nbsp;&lt;STRONG&gt;before QvdInfo&lt;/STRONG&gt;)&lt;/P&gt;
&lt;P&gt;LCaseFields:&lt;BR /&gt;Mapping Load * Inline [&lt;BR /&gt;FromName,ToName&lt;BR /&gt;Year,year&lt;BR /&gt;Month,month&lt;BR /&gt;Day,day&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then insert highlighted row&amp;nbsp; &lt;STRONG&gt;before temp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;temp1:&lt;BR /&gt;LOAD *&lt;BR /&gt;FROM [$(vQvdPath)/$(vQvdFile)](qvd);&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF6600"&gt;&lt;STRONG&gt;Rename fields using LCaseFields;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;NoConcatenate &lt;BR /&gt;temp:&lt;BR /&gt;Load Distinct&lt;BR /&gt;year&amp;amp;month&amp;amp;day as Date_temp // This is where it fails if a qvd has Year/Month/Day as field names&lt;BR /&gt;Resident temp1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Feb 2023 02:28:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Lower-case-all-field-names-not-field-values-automatically/m-p/2035253#M85314</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2023-02-08T02:28:45Z</dc:date>
    </item>
  </channel>
</rss>

