<?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: Date conversion SAP Field LIKP.WADAT_IST doesn't work in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512980#M600264</link>
    <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it is frustrating. Exporting from SAP to plain text gives the format YYYY-MM-DD. But using this format with date# also doesn't work. I now tried all formulas (in the script) which could give a hint:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bild1.png" style="width: 928px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1095i47654E2BB25F5094/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bild1.png" alt="Bild1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you can see I got bull**bleep**. Only the last two records are correct. But I&amp;nbsp;identyfied that if I only read these 8 VBELN_POSNR each date is converted correctly. May there be a bug, handling quite a lot data at the SAP Connector?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Heike.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Nov 2018 14:45:45 GMT</pubDate>
    <dc:creator>hlauerhaas</dc:creator>
    <dc:date>2018-11-27T14:45:45Z</dc:date>
    <item>
      <title>Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1511012#M600260</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;it drives me mad. I have tables from SAP (LIKP &lt;EM&gt;delivery head&lt;/EM&gt; and LIPS &lt;EM&gt;delivery position&lt;/EM&gt;) where a date WADAT_IST can be found. If I want to extract the year, month and so on at the designer, it works pretty well. When doing the same at the script, QlikView gives back the strangest values. Here is the relevant part of my code and a screenshot of the tablechart:&lt;/P&gt;&lt;PRE&gt;Lieferung:
LOAD	VBELN 																								AS LIKP_LIPS.VBELN_Lieferung, 
		POSNR 																								AS LIKP_LIPS.POSNR_Lieferpostion,
		VBELN &amp;amp; '-' &amp;amp; POSNR																					AS LIKP_LIPS.VBELN_POSNR,
		VGBEL 																								AS LIKP_LIPS.VGBEL_Vorgaengerbeleg,
		VGPOS 																								AS LIKP_LIPS.VGPOS_Vorgaengerbelegposition,
		VGBEL &amp;amp; '-' &amp;amp; VGPOS 																				AS LIKP_LIPS.VGBEL_VGPOS, //verknüpftes Feld
		LFIMG																								AS LIKP_LIPS.LFIMG_gelieferteMenge;		
SQL 	SELECT	VBELN POSNR LFIMG VGBEL VGPOS
		FROM	LIPS
		WHERE	VGBEL IS NOT NULL AND VGBEL &amp;gt; 0 AND VGPOS &amp;gt; 0;

LEFT JOIN (Lieferung)
LOAD	VBELN																								AS LIKP_LIPS.VBELN_Lieferung,
		WADAT_IST																							AS LIKP_LIPS.WADAT_IST_IstWarenbewegungsdatum,
		date(date#(WADAT_IST,'YYYYMMDD'),'YYYY/MM/DD')														AS LIKP_LIPS.WADAT_IST_IstWarenbewegungsdatum_Date#,
		MakeDate(Left(WADAT_IST,4), Mid(WADAT_IST, 5,2), Right(WADAT_IST,2)) 								AS LIKP_LIPS.WADAT_IST_IstWarenbewegungsdatum_MakeDate,
		date(WADAT_IST)																						aS LIKP_LIPS.WADAT_IST_IstWarenbewegungsdatum_Datum,
				Year(WADAT_IST) 																			As LIKP_LIPS.WADAT_IST_Jahr,
				ApplyMap('Mapping_Quartal', month(WADAT_IST), Null()) 										As LIKP_LIPS.WADAT_IST_Quartal,		
				Month(WADAT_IST) 																			As LIKP_LIPS.WADAT_IST_Monat,
				Date(monthstart(WADAT_IST), 'YYYY-MM') 														As LIKP_LIPS.WADAT_IST_JahrMonat,	
				Week(WADAT_IST) 																			As LIKP_LIPS.WADAT_IST_Woche,  
				WeekYear(WADAT_IST) &amp;amp; '-' &amp;amp;  num(Week(weekstart(WADAT_IST)),'00')  							As LIKP_LIPS.WADAT_IST_Kalenderwoche,  
				Day(WADAT_IST) 																				As LIKP_LIPS.WADAT_IST_Tag,  
				WeekDay(WADAT_IST) 																			As LIKP_LIPS.WADAT_IST_Wochentag,
				Year(WADAT_IST) + Evaluate(ApplyMap('Mapping_Geschaeftsjahr', month(WADAT_IST), Null())) 	AS LIKP_LIPS.WADAT_IST_Geschaeftsjahr, 
				ApplyMap('Mapping_Geschaeftsperiode', month(WADAT_IST), Null()) 							AS LIKP_LIPS.WADAT_IST_Geschaeftsperiode,
				Year(WADAT_IST) + Evaluate(ApplyMap('Mapping_Geschaeftsjahr', month(WADAT_IST), Null())) 	 
					&amp;amp; '-' &amp;amp; ApplyMap('Mapping_Geschaeftsperiode', month(WADAT_IST), Null()) 				AS LIKP_LIPS.WADAT_IST_Geschaeftsjahrperiode,
		ROUTE																								AS LIKP_LIPS.ROUTE_Transportroute,
		ApplyMap('MAPPING_ROUTE',ROUTE,'#NV') 																AS LIKP_LIPS.ROUTE_Transportroute_Tage;		
SQL		SELECT 	VBELN WADAT_IST ROUTE 
		FROM 	LIKP;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tablechart.jpg" style="width: 886px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/832iB7632B1A4A44949B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Tablechart.jpg" alt="Tablechart.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I don't have any idea, what i am doing wrong. It has already taken me days. Please help.&lt;/P&gt;&lt;P&gt;kind regards&lt;/P&gt;&lt;P&gt;Heike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 10:48:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1511012#M600260</guid>
      <dc:creator>hlauerhaas</dc:creator>
      <dc:date>2018-11-22T10:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1511169#M600261</link>
      <description>&lt;P&gt;Personally I would quite probably not do it in this way else I would just join both tables without any formatting of the date or creating further period-fields - and then using a master-calendar (and maybe a financial calendar) which are associated to your target-table. For more information see here: &lt;A href="https://community.qlik.com/t5/QlikView-Documents/How-to-use-Master-Calendar-and-Date-Values/ta-p/1495741" target="_blank"&gt;How-to-use-Master-Calendar-and-Date-Values&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;This isn't a direct solution to your failed formatting-stuff - date(date#()) with the proper format-strings should work well and if there are multiple different formattings an alt(Date1, Date2, ...) will catch them all - but it should simplify your task.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 13:32:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1511169#M600261</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-11-22T13:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512181#M600262</link>
      <description>&lt;P&gt;Hello Marcus,&lt;/P&gt;&lt;P&gt;thank you for replying. To use a master- or a canonical calendar does not work, because I would get circular references. I already tryed to integrate such a calendar. Besides it does not solve the actual problem, because I also could not get a regular date out of my field.&lt;/P&gt;&lt;P&gt;Anyway, thanks&lt;/P&gt;&lt;P&gt;Heike&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 12:23:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512181#M600262</guid>
      <dc:creator>hlauerhaas</dc:creator>
      <dc:date>2018-11-26T12:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512224#M600263</link>
      <description>&lt;P&gt;Hi Heike,&lt;/P&gt;&lt;P&gt;the handling of multiple calendars within an application could be difficult but with a proper naming of the fields it's possible to avoid synthetic keys and circular loops.&lt;/P&gt;&lt;P&gt;Beside this if your converting of the date/timestamp-fields failed it will be caused from a not suitable format-string - maybe there are any additionally spaces or other special chars included or your date is really a timestamp or ... This means you need to know exactly the data to apply the right converting.&lt;/P&gt;&lt;P&gt;If you load the SAP data from a flat-file export you could use a editor like Notepad ++ to look which data are really there and by loading them with a SAP connector or a ODBC driver (without an applied converting/formatting) you could use QlikView to see how the data look like and also measure them with len(), ord() and so on.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 12:57:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512224#M600263</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-11-26T12:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512980#M600264</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it is frustrating. Exporting from SAP to plain text gives the format YYYY-MM-DD. But using this format with date# also doesn't work. I now tried all formulas (in the script) which could give a hint:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bild1.png" style="width: 928px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/1095i47654E2BB25F5094/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bild1.png" alt="Bild1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As you can see I got bull**bleep**. Only the last two records are correct. But I&amp;nbsp;identyfied that if I only read these 8 VBELN_POSNR each date is converted correctly. May there be a bug, handling quite a lot data at the SAP Connector?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Heike.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:45:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1512980#M600264</guid>
      <dc:creator>hlauerhaas</dc:creator>
      <dc:date>2018-11-27T14:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1513018#M600265</link>
      <description>&lt;P&gt;Hi Heike,&lt;/P&gt;&lt;P&gt;yes, it looks strange. I don't know any of the SAP connectors (our main sources are different and the few monthly SAP data which we include are manually exported) and therefore I have no own experience of how it's technically implemented. But if I look on your screenshot it seems that the date is a dual-value and that there is something wrong with the string-representation.&lt;/P&gt;&lt;P&gt;Therefore I'm not sure that your suggestion that the last two records are the right ones are correct. In regard to the results of various ord-values and the date# and num I would assume that num contains the right values and would use:&lt;/P&gt;&lt;P&gt;date(YourNumExpression) // probably just num(Field)&lt;/P&gt;&lt;P&gt;to get the right date-value. Of course you need to check this with any unique ID and/or an additionally recno() / rowno() within the loading.&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 15:23:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1513018#M600265</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2018-11-27T15:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Date conversion SAP Field LIKP.WADAT_IST doesn't work</title>
      <link>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1514685#M600266</link>
      <description>&lt;P&gt;Hi Marcus,&lt;/P&gt;&lt;P&gt;got it. It seems to be the QlikView-Client. When running the script a number of times&amp;nbsp;&lt;SPAN&gt;seriatim, I got different results every time. Dates converting wrong work fine at the next load and dates looking fine did not work at the next load. Other users&amp;nbsp; have the same problem. Running the same script with the Qlikview AccessPoint have given always the right dates.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So I think I got the cause but not the reason why.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have 11.20.12904.0 SR12 64-bit installed on Win10. Other users, who testet it for me, have 64-bit Win7 and 32-bit Win7. I think I will address it to the support of our distributor for clarifying wether there is a bug known.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Nethertheless many thanks for your efforts.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Heike.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Nov 2018 08:47:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Date-conversion-SAP-Field-LIKP-WADAT-IST-doesn-t-work/m-p/1514685#M600266</guid>
      <dc:creator>hlauerhaas</dc:creator>
      <dc:date>2018-11-30T08:47:13Z</dc:date>
    </item>
  </channel>
</rss>

