<?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: Re: Cross table - need help plz.. in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657487#M240038</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a more generic solution in mind, that could also cope with multiple driver intervals per name, vehicle and day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic3.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69245_QlikCommunity_Thread_138591_Pic3.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic4.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69246_QlikCommunity_Thread_138591_Pic4.JPG.jpg" style="width: 620px; height: 75px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14136708709772285" jivemacro_uid="_14136708709772285"&gt;
&lt;P&gt;tabInput:&lt;/P&gt;
&lt;P&gt;CrossTable (TimeTxt, Role, 2)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM QlikCommunity_Thread_138591.txt (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TimeTxt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time#(TimeTxt) as Time&lt;/P&gt;
&lt;P&gt;Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time start') as TimeTypeTemp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), RangeSum(Peek(ID),1),Peek(ID)) as ID&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time end', TimeTypeTemp) as TimeType&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabVehicleDriverUsage:&lt;/P&gt;
&lt;P&gt;Generic LOAD ID, Name, equipment, TimeType, Time Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tabInput;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe this helps also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 18 Oct 2014 22:22:06 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2014-10-18T22:22:06Z</dc:date>
    <item>
      <title>Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657482#M240033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data as mentioned in excel.. Using cross table i have created mutliple lines.But would like to reduce the no of lines as mentioned clearly in excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to reduce the no of lines when a person like abc is continuously working as driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refer the excel..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions would be greatly appreciated..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 12:51:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657482#M240033</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-18T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657483#M240034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here you go !!! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 13:11:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657483#M240034</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-10-18T13:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657484#M240035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one solution could be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69233_QlikCommunity_Thread_138591_Pic1.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1413641633775431" jivemacro_uid="_1413641633775431"&gt;
&lt;P&gt;tabInput:&lt;/P&gt;
&lt;P&gt;CrossTable (Time, Role, 2)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="132886" data-objecttype="13" href="http://community.qlik.com/servlet/JiveServlet/download/2051-138591-637232-132886/Sample+data.xlsx"&gt;http://community.qlik.com/servlet/JiveServlet/download/637232-132886/Sample%20data.xlsx&lt;/A&gt;&lt;SPAN&gt;] (ooxml, embedded labels, table is Sheet1, filters(&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Remove(Row, Pos(Top, 12)),Remove(Row, Pos(Top, 11)),Remove(Row, Pos(Top, 10)),Remove(Row, Pos(Top, 9)),Remove(Row, Pos(Top, 8)),Remove(Row, Pos(Top, 7)),Remove(Row, Pos(Top, 6)),Remove(Row, Pos(Top, 5)),Remove(Row, Pos(Top, 4))));&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time start') as TimeTypeTemp&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time end', TimeTypeTemp) as TimeType&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabVehicleDriverUsage:&lt;/P&gt;
&lt;P&gt;Generic LOAD Name, equipment, TimeType, Time(Num#(Time)) Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tabInput;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 14:14:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657484#M240035</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-18T14:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657485#M240036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try below script,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14136442051251443" jivemacro_uid="_14136442051251443" modifiedtitle="true"&gt;
&lt;P&gt;table1:&lt;/P&gt;
&lt;P&gt;CrossTable (Time, Value,2)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM&lt;/P&gt;
&lt;P&gt;Sample data.xlsx&lt;/P&gt;
&lt;P&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;table2:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;NoConcatenate&lt;/P&gt;
&lt;P&gt;LOAD&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Name,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; equipment,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Time(Max(Num#(Time))) as EndTime,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Time(Min(Num#(Time))) as StartTime&lt;/P&gt;
&lt;P&gt;Resident table1&lt;/P&gt;
&lt;P&gt;Where Value='driver'&lt;/P&gt;
&lt;P&gt;Group By Name,equipment;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table table1;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 14:55:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657485#M240036</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-10-18T14:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657486#M240037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your replies.. sorry that i have missed to provide the details of my requirement more clearly.. Now i have added new data highlighted in red color and the required result in a new sheet.. Could you please help me with the required table in QV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you have any questions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 22:19:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657486#M240037</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-18T22:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657487#M240038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had a more generic solution in mind, that could also cope with multiple driver intervals per name, vehicle and day:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic3.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69245_QlikCommunity_Thread_138591_Pic3.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic4.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69246_QlikCommunity_Thread_138591_Pic4.JPG.jpg" style="width: 620px; height: 75px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14136708709772285" jivemacro_uid="_14136708709772285"&gt;
&lt;P&gt;tabInput:&lt;/P&gt;
&lt;P&gt;CrossTable (TimeTxt, Role, 2)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;FROM QlikCommunity_Thread_138591.txt (txt, codepage is 1252, embedded labels, delimiter is '\t', msq);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TimeTxt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time#(TimeTxt) as Time&lt;/P&gt;
&lt;P&gt;Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time start') as TimeTypeTemp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), RangeSum(Peek(ID),1),Peek(ID)) as ID&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(Role='driver' and (Previous(Role)&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time end', TimeTypeTemp) as TimeType&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabVehicleDriverUsage:&lt;/P&gt;
&lt;P&gt;Generic LOAD ID, Name, equipment, TimeType, Time Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tabInput;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;maybe this helps also?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 22:22:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657487#M240038</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-18T22:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657488#M240039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;forgot the source.&lt;/P&gt;&lt;P&gt;Now attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 22:27:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657488#M240039</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-18T22:27:06Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657489#M240040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought as much that this was your real intention ... &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic5.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69247_QlikCommunity_Thread_138591_Pic5.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="_jivemacro_uid_14136720032965490 jive_text_macro jive_macro_code" jivemacro_uid="_14136720032965490"&gt;
&lt;P&gt;tabInput:&lt;/P&gt;
&lt;P&gt;CrossTable (TimeTxt, Role, 2)&lt;/P&gt;
&lt;P&gt;LOAD *&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="" data-containerid="-1" data-containertype="-1" data-objectid="132907" data-objecttype="13" href="http://community.qlik.com/servlet/JiveServlet/download/2051-138591-637367-132907/Sample+data.xlsx"&gt;http://community.qlik.com/servlet/JiveServlet/download/637367-132907/Sample%20data.xlsx&lt;/A&gt;&lt;SPAN&gt;] (ooxml, embedded labels, table is Sheet1);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Distinct&lt;/P&gt;
&lt;P&gt;&amp;nbsp; TimeTxt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Time(Num#(TimeTxt)) as Time&lt;/P&gt;
&lt;P&gt;Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(lower(Role)='driver' and (Previous(lower(Role))&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time start') as TimeTypeTemp,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(lower(Role)='driver' and (Previous(lower(Role))&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), RangeSum(Peek(ID),1),Peek(ID)) as ID&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Left Join (tabInput)&lt;/P&gt;
&lt;P&gt;LOAD Name, equipment, Time,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If(lower(Role)='driver' and (Previous(lower(Role))&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), 'time end', TimeTypeTemp) as TimeType&lt;/P&gt;
&lt;P&gt;Resident tabInput&lt;/P&gt;
&lt;P&gt;Order By Name, equipment, Time desc;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabVehicleDriverUsage:&lt;/P&gt;
&lt;P&gt;Generic LOAD ID, Name, equipment, TimeType, Time Resident tabInput;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;DROP Table tabInput;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Oct 2014 22:40:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657489#M240040</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-18T22:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657490#M240041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Macro,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks alot for your quick response. I have couple of questions in the solution plz..&lt;/P&gt;&lt;P&gt;may i know the reason for maintaining the synthetic key.. can we eliminate it..? and what is the reason for the usuage&amp;nbsp; of generic load.. Could you please use the excel attached as your source for your script generation.. when I change the source of the file in your code the numbers are breaking.. Not sure what was the reason.. could you because of the format of the data is causing the numbers to break..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="256"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD colspan="2" height="20" width="128"&gt;Required table&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;abc&lt;/TD&gt;&lt;TD&gt;vehicle1&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;06:00:00&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;08:00:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="20"&gt;xyz&lt;/TD&gt;&lt;TD&gt;vehicle2&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;08:00:00&lt;/TD&gt;&lt;TD align="right" class="xl63"&gt;09:20:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;abc&lt;/TD&gt;&lt;TD class="xl64"&gt;vehicle1&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;09:20:00&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;10:40:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="20"&gt;xyz&lt;/TD&gt;&lt;TD class="xl64"&gt;vehicle2&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;10:00:00&lt;/TD&gt;&lt;TD align="right" class="xl65"&gt;11:20:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly refer the excel for the source data in sheet1.Please let me know if you have more questions..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 07:22:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657490#M240041</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-19T07:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657491#M240042</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already adapted my solution to your source file&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/servlet/JiveServlet/download/2051-138591-637367-132907/Sample data.xlsx" title="http://community.qlik.com/servlet/JiveServlet/download/637367-132907/Sample%20data.xlsx"&gt;http://community.qlik.com/servlet/JiveServlet/download/637367-132907/Sample%20data.xlsx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;in this post:&lt;A href="https://community.qlik.com/message/637379"&gt;Re: Re: Cross table - need help plz..&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you change your requirements?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 07:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657491#M240042</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-19T07:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657492#M240043</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Macro,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;No I have not changed my requirement.. I have taken the file which you gave and changed the source details to my local file.. But the numbers are breaking... &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Also could you please clarify me on the clarifications i have asked you in the previous post..&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Attaching the file for your reference.. Please let me know if I missed anything and kindly let me know what could be the reason for not getting the results when i change the source file path..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for your quick responses...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 20:43:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657492#M240043</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-19T20:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657493#M240044</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Marco I have misspelled your name..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 20:47:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657493#M240044</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-19T20:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657494#M240045</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I adapted the script to your latest file and got this result:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="QlikCommunity_Thread_138591_Pic1.JPG.jpg" class="jive-image" src="https://community.qlik.com/legacyfs/online/69261_QlikCommunity_Thread_138591_Pic1.JPG.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;QVW and XLS attached.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 23:13:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657494#M240045</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-19T23:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657495#M240046</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think the synthetic keys in this case are that "evil". There are a number of interesting discussions regarding this topic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/thread/10279"&gt;Should We Stop Worrying and Love the Synthetic Key?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys" title="http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2013/04/16/synthetic-keys&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the recombination of the generic tables into one, there is also a fine post that recommends &lt;STRONG&gt;not&lt;/STRONG&gt; to do so, although it's possible:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic" title="http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic"&gt;http://community.qlik.com/blogs/qlikviewdesignblog/2014/03/31/generic&lt;/A&gt;&lt;/P&gt;&lt;P&gt;by &lt;A href="https://community.qlik.com/qlik-users/4003"&gt;Henric Cronström&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps as well&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Oct 2014 23:21:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657495#M240046</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-19T23:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657496#M240047</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px;"&gt;Lavanya&lt;/SPAN&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you asked the following questions via message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;- Could you please let me know the use of the below statement in the solution that you have provided to me..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;If(lower(Role)='driver' and (Previous(lower(Role))&amp;lt;&amp;gt;'driver' or Previous(equipment)&amp;lt;&amp;gt;equipment or Previous(Name)&amp;lt;&amp;gt;Name), RangeSum(Peek(ID),1),Peek(ID)) as ID..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Also if i restrict the data to Driver in where clause then ii hope there is no need of the lower(Role) = 'driver'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;- DROP Table tabInput; the table has been dropped but still what could be the reason of synthetic key in the data model... could you please tell me the reason.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;I used these statements to mark each consecutive driver block with a ID that I could use to associate the start and end times during the generic load.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;One way to delete the synthetic keys could be to recombine the generic tables into one as described in the above mentioned threads regarding generic loads and synthetic keys&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Marco&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="gt-baf-table" style="color: #777777; font-family: arial, sans-serif;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD colspan="2"&gt;&lt;P class="gt-baf-cell gt-baf-word-clickable" style="margin: 1px 0 0 4px; color: #000000; text-decoration: underline;"&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 12px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 11:00:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657496#M240047</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-21T11:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657497#M240048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I managed to get the synthetic key eliminated in the model.. Thanks for your reply....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 14:45:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657497#M240048</guid>
      <dc:creator>lavanya14</dc:creator>
      <dc:date>2014-10-21T14:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: Cross table - need help plz..</title>
      <link>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657498#M240049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you like, you can mark helpful whatever reply helped you solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Oct 2014 15:04:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Cross-table-need-help-plz/m-p/657498#M240049</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2014-10-21T15:04:07Z</dc:date>
    </item>
  </channel>
</rss>

