<?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: Generate month and year fields for a data set that don't contain date fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625174#M46543</link>
    <description>&lt;P&gt;As Marcus is saying, you can create conditions to load just about anything, even use sheet names. However, the more inconsistencies in file&amp;amp;sheet names you have, the more conditions in load script. Is this really the way you want to go? You may be already at the point, when creating the script is more work than actually renaming the files.&lt;/P&gt;&lt;P&gt;The best practice I use with my clients is to agree on naming conventions and use that. Anything with wrong name doesn't get loaded&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 11:14:11 GMT</pubDate>
    <dc:creator>DavidM</dc:creator>
    <dc:date>2019-09-18T11:14:11Z</dc:date>
    <item>
      <title>Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625018#M46528</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have create an app using qlik sense. The source data is excel files and every file represent one month. So I get every month an excel file to load it. All the files have the same structure, so I use the following approach:&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; D,&lt;BR /&gt;FROM [lib://AttachedFiles/Jan2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;Concatenate Load&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; A,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; B,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; C,&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; D,&lt;BR /&gt;FROM [lib://AttachedFiles/Feb2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;How can I dedicate the month and the year while there is no field can be used as date.&lt;/P&gt;&lt;P&gt;I think it can be solve by generating a number field in every file and use it as month:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Load&lt;/P&gt;&lt;P&gt;Month,A,B,C,D&lt;BR /&gt;1,name,surname,country,city&lt;BR /&gt;1,name,surname,country,city&lt;BR /&gt;1,name,surname,country,city&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FROM [lib://AttachedFiles/Jan2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;Concatenate Load&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Month,A,B,C,D&lt;BR /&gt;2,name,surname,country,city&lt;BR /&gt;2,name,surname,country,city&lt;BR /&gt;2,name,surname,country,city&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FROM [lib://AttachedFiles/Feb2019.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;but i don't know how to achieve this in the script while there is too much rows. And how it could be generated automatically every month.&lt;/P&gt;&lt;P&gt;Thanks in advance&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 20:03:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625018#M46528</guid>
      <dc:creator>HAAM</dc:creator>
      <dc:date>2024-11-16T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625024#M46529</link>
      <description>&lt;P&gt;You could read the filename, for example:&lt;/P&gt;&lt;P&gt;Table:&lt;BR /&gt;Load *, month(Date) as Month, year(Date) as Year; // or maybe just using a master-calendar&lt;BR /&gt;Load A, B, C, D, date(date#(&lt;STRONG&gt;filebasename&lt;/STRONG&gt;(), 'MMMYYYY')) as Date&lt;BR /&gt;FROM [lib://AttachedFiles/&lt;STRONG&gt;*&lt;/STRONG&gt;.xlsx]&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 07:53:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625024#M46529</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-18T07:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625027#M46530</link>
      <description>&lt;P&gt;You can create the name of the months from &lt;A href="https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Scripting/FileFunctions/FileName.htm" target="_blank"&gt;FileName()&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This gives you the full name of the table. So something like this:&lt;/P&gt;&lt;P&gt;Right(Subfield(FileName(),'.',1)4) as Year&lt;/P&gt;&lt;P&gt;Left(Subfield(FileName(),'.',1)3) as Month&lt;/P&gt;&lt;P&gt;As long as all your files have format: MMMYYYY.xls&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 07:53:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625027#M46530</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-18T07:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625047#M46532</link>
      <description>&lt;P&gt;Thank you Marcus and David for quick reply.&lt;/P&gt;&lt;P&gt;I still have the problem while I don't have&amp;nbsp;always the format for the file names.&lt;/P&gt;&lt;P&gt;sometimes it can be like that:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [lib://AttachedFiles/&lt;/SPAN&gt;&lt;STRONG&gt;mar+apr&lt;/STRONG&gt;&lt;SPAN&gt;.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ooxml, embedded labels, table is Sheet1);&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [lib://AttachedFiles/&lt;/SPAN&gt;&lt;STRONG&gt;DE_201902&lt;/STRONG&gt;&lt;SPAN&gt;.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ooxml, embedded labels, table is Sheet1);&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 08:16:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625047#M46532</guid>
      <dc:creator>HAAM</dc:creator>
      <dc:date>2019-09-18T08:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625051#M46533</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;so you could try something like this&lt;/P&gt;&lt;P&gt;If(Index(filebasename(),'_')&amp;gt;0, Date(Date#(SubField(filebasename(),'_',2),'YYYYMM'),'MM'),&lt;/P&gt;&lt;P&gt;If(Index(filebasename(),'+')&amp;gt;0, Date(Date#(SubField(filebasename(),'+'),'MMM'),'MM'),&amp;nbsp; date(date#(filebasename(), 'MMMYYYY'),'MM')))&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 08:24:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625051#M46533</guid>
      <dc:creator>StarinieriG</dc:creator>
      <dc:date>2019-09-18T08:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625056#M46534</link>
      <description>&lt;P&gt;The main principle won't change - you need to read the information from the filename. If the filename-logic differs you will need to implement multiple if-loops to identify the pattern (for example checking if the filename contained any numbers, chars, special chars with keepchar(), isnum() and similar functions) and applying then the appropriate converting.&lt;/P&gt;&lt;P&gt;But if there information are missing like the year you need to add them on another way and also the combination of multiple files is quite difficult to handle - I think I would load them twice / several times and divide their measares through the iteration-number.&lt;/P&gt;&lt;P&gt;How expensive those efforts are depends of the variety of the possible combinations. The above mentioned approaches are rather a worse-case scenario and I recommend to solve the difficulties in beforehand applying strict rules to the data-structure and the fielnames of your data - everything else will always cause additionally work.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 08:34:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625056#M46534</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-18T08:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625057#M46535</link>
      <description>&lt;P&gt;You what need to create dates using IF conditions.&lt;/P&gt;&lt;P&gt;Btw what do you do when date is mar+apr?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 08:35:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625057#M46535</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-18T08:35:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625096#M46536</link>
      <description>&lt;P&gt;When I have the file name like mar+apr it contain 2 sheets&amp;nbsp; so I load them from the same file&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [lib://AttachedFiles/&lt;/SPAN&gt;&lt;STRONG&gt;mar+apr&lt;/STRONG&gt;&lt;SPAN&gt;.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ooxml, embedded labels, &lt;U&gt;table is DE_201903&lt;/U&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;...&lt;BR /&gt;FROM [lib://AttachedFiles/&lt;STRONG&gt;mar+apr&lt;/STRONG&gt;.xlsx]&lt;BR /&gt;(ooxml, embedded labels, &lt;U&gt;table is DE_201904&lt;/U&gt;);&amp;nbsp;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can i use&amp;nbsp; the table name in this case?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 09:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625096#M46536</guid>
      <dc:creator>HAAM</dc:creator>
      <dc:date>2019-09-18T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625118#M46537</link>
      <description>&lt;P&gt;If there are multiple sheets you will need an additionally loop to load from there - means the classical wildcard-loading won't work. Reading the sheetnames is in general also possible but it requires to load the Excel per ODBC.&lt;/P&gt;&lt;P&gt;Everything is possible but it won't be simple and needs some efforts to consider all the variety ... Therefore again my recommendation of solving these difficulties in beforehand. Probably there are some more challenges with your data ... the best technically capabilities will be quite useless if there is no valid concept about the data and their quality ...&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 09:55:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625118#M46537</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-18T09:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625174#M46543</link>
      <description>&lt;P&gt;As Marcus is saying, you can create conditions to load just about anything, even use sheet names. However, the more inconsistencies in file&amp;amp;sheet names you have, the more conditions in load script. Is this really the way you want to go? You may be already at the point, when creating the script is more work than actually renaming the files.&lt;/P&gt;&lt;P&gt;The best practice I use with my clients is to agree on naming conventions and use that. Anything with wrong name doesn't get loaded&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:14:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625174#M46543</guid>
      <dc:creator>DavidM</dc:creator>
      <dc:date>2019-09-18T11:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625192#M46545</link>
      <description>&lt;P&gt;Thank you all for the proper solution,&lt;/P&gt;&lt;P&gt;Like you said Marcus the best way is to solve it&amp;nbsp;&lt;SPAN&gt;in beforehand.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But before&amp;nbsp; this card is being closed with the solution.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you please explain me the approach to load the date from table name and which functions can be used for that?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FROM [lib://AttachedFiles/&lt;/SPAN&gt;&lt;STRONG&gt;mar+apr&lt;/STRONG&gt;&lt;SPAN&gt;.xlsx]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(ooxml, embedded labels,&amp;nbsp;&lt;U&gt;table is &lt;FONT color="#800000"&gt;&lt;STRONG&gt;DE_201903&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/U&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:38:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625192#M46545</guid>
      <dc:creator>HAAM</dc:creator>
      <dc:date>2019-09-18T11:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: Generate month and year fields for a data set that don't contain date fields</title>
      <link>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625198#M46547</link>
      <description>&lt;P&gt;There is no native functionality in Qlik else it needs to be done per SQL or VBA/VBS. Here a few examples:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-App-Development/How-to-load-multiple-sheets-on-excel-file-into-Qlikview/m-p/839252" target="_self"&gt;How-to-load-multiple-sheets-on-excel-file-into-Qlikview&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/t5/QlikView-Scripting/Load-data-from-multiple-sheets-of-excel-file-dynamic-sheet-count/m-p/826573" target="_self"&gt;Load-data-from-multiple-sheets-of-excel-file-dynamic-sheet-count&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Another approach but not easier would be to unzip the XLSX (also per EXECUTE statement) and then reading the various xml-files to find the included sheets.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:52:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Generate-month-and-year-fields-for-a-data-set-that-don-t-contain/m-p/1625198#M46547</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2019-09-18T11:52:57Z</dc:date>
    </item>
  </channel>
</rss>

