<?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: Make visitnumbers from inspectiondates in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44910#M787838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The GROUP BY was indeed the solution. Next problem was that the sort of the inspection dates where not equal whith the visitdate numbers. So I added finaly an ORDER BY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The perfect working script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DebtorNr,&lt;/P&gt;&lt;P&gt;UitvoerDat,&lt;/P&gt;&lt;P&gt;Max(Date#(UitvoerDat,'DD-MM-YYYY')) as Date2&lt;/P&gt;&lt;P&gt;GROUP BY DebtorNr, UitvoerDat ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sql Select DebtorNr, UitvoerDat FROM&amp;nbsp; "NBC_e-Connect". dbo.[NBC_QV_HygieneInspectie_B&amp;amp;B] ORDER BY DebtorNr, UitvoerDat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;'Bez ' &amp;amp; VistNrTemp as VisitNr;&lt;/P&gt;&lt;P&gt;LOAD*,&lt;/P&gt;&lt;P&gt;if(previous(DebtorNr)=DebtorNr and not(IsNull(DebtorNr)),Peek(VistNrTemp)+1,1) as VistNrTemp&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;Order by DebtorNr, Date2 asc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The normal table, each company vertical...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="a1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/194019_a1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the new cross table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="a2.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/194020_a2.jpg" style="height: 316px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfect Jaume!&lt;/P&gt;&lt;P&gt;Thanks a lot for your help... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Feb 2018 10:57:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-02-21T10:57:39Z</dc:date>
    <item>
      <title>Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44905#M787833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;I am not very good in qlikview but I manage most of time, but some times it's a headbreaker and cannot find out how to solve or if there is a solution anyway.&amp;nbsp; I am from the Netherlands and my English is also not very well, but I hoop understandable &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to explain my question&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each customer there are different inspection dates over the year. For each inspection there is a result in points.&lt;/P&gt;&lt;P&gt;I made a table with the results. First name of the company then later inspectiondate and the calculated score. Depending on the score it will color red, orange or green.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/193720_1.jpg" style="height: 353px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;Most inportant is that we can see very fast the color result of each company. Because more times behind each other not a green color needs immidiatly action. So in this cas I want to make a crosstable!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Problem are the inspectiondates. They are for each visit diffirent. The result is showing in the next image:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/193730_2.jpg" style="height: 108px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;It is showing for all the companys all the inspections dates available in the data. Now it also gives more green colors because the inspection date which is not there for a company is giving the value 0. (color green) It is not the calculated value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am searching for a load script to put a new value on the visitdate of each seperate company. (flag) Like for the first inspectiondate a label Visit 1, for the second inspectiondate a label Visit 2.. and so on...&lt;/P&gt;&lt;P&gt;For the cross table I can use the labels because the dates are not important, but the colors behind each other.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example in Excel:&lt;/P&gt;&lt;P&gt;The data, by loading script the first inspection date for company A gets a label Visit 1, the second inspection date Visit 2, and so on&lt;/P&gt;&lt;P&gt;&lt;IMG alt="3.jpg" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/193731_3.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cross table will look this way. You can immidiatly see the color results for each company.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4a.jpg" class="image-4 jive-image" src="https://community.qlik.com/legacyfs/online/193733_4a.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this practicle possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly regards,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44905#M787833</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44906#M787834</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 have attached a QVW that can give you a solution of your problem. Please check and reply if you have any concerns.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 11:52:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44906#M787834</guid>
      <dc:creator>jaumecf23</dc:creator>
      <dc:date>2018-02-19T11:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44907#M787835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Exactly the way I wanted it... You don't know how happy I am with this. it's really great!&lt;/P&gt;&lt;P&gt;Now I only need an orderby clausule.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each inspection has about 65 inspectionpoints. So in the table for each inspection point record there is the same inspectiondate. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="2.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/193845_2.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the results voor each inpspectionpoint in now a visitnumber... So there must be a kind of groupby in the script? Is that possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="1.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/193846_1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You really are great. This is so cool!&amp;nbsp; Thanks Jaume!&lt;/P&gt;&lt;P&gt;Kindly regards, Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 19:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44907#M787835</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-19T19:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44908#M787836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This morning I realise that I didn't put enough information in my last answer.&lt;/P&gt;&lt;P&gt;The data I use is coming from a SQL server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4a.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/193860_4a.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;As you can see is each record the same because each inspection has about 65 inspectionpoints.&lt;/P&gt;&lt;P&gt;(Uitvoerdat = inspectiondate)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="4.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/193861_4.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;When I use a Group By function it's shows the records I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in the script Ik thought to load the data also by Group By:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Temp:&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DebtorNr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Uitvoerdat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//Date#(Uitvoerdat,'DD-MM-YYYY') as Date2;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Uitvoerdat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'DD-MM-YYYY') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Date2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;GROUP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;DebtorNr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;UitvoerDat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt;"&gt;//Sql Select DebtorNr, Uitvoerdat FROM "NBC_e-Connect". dbo.[NBC_QV_HygieneInspectie_B&amp;amp;B];&lt;BR /&gt; &lt;/SPAN&gt;&lt;STRONG style=": ; color: #0000ff; font-size: 8pt;"&gt;Sql&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; SELECT DebtorNr, UitvoerDat FROM &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;"NBC_e-Connect"&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;.dbo.[NBC_QV_HygieneInspectie_B&amp;amp;B] GROUP BY DebtorNr, UitvoerDat;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is nog accept because I get the error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="3.jpg" class="jive-image image-3" src="https://community.qlik.com/legacyfs/online/193870_3.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;Where do I hav tuse this function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly Regards,&lt;/P&gt;&lt;P&gt;Jan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 06:06:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44908#M787836</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-20T06:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44909#M787837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use the Group By &lt;SPAN style="font-size: 13.3333px;"&gt;expression&lt;/SPAN&gt;, the fields that are not included in the group by clause, for that fields is necessary to use a aggregation formula. Try this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Temp:&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;LOAD&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;DebtorNr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;Uitvoerdat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #008000;"&gt;//Date#(Uitvoerdat,'DD-MM-YYYY') as Date2;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;Max(Date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;Uitvoerdat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;,'DD-MM-YYYY')) &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;Date2&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;GROUP&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #0000ff;"&gt;BY&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;DebtorNr&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;, &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #800000;"&gt;UitvoerDat&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Feb 2018 08:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44909#M787837</guid>
      <dc:creator>jaumecf23</dc:creator>
      <dc:date>2018-02-20T08:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44910#M787838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaume,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The GROUP BY was indeed the solution. Next problem was that the sort of the inspection dates where not equal whith the visitdate numbers. So I added finaly an ORDER BY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The perfect working script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Temp:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;DebtorNr,&lt;/P&gt;&lt;P&gt;UitvoerDat,&lt;/P&gt;&lt;P&gt;Max(Date#(UitvoerDat,'DD-MM-YYYY')) as Date2&lt;/P&gt;&lt;P&gt;GROUP BY DebtorNr, UitvoerDat ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sql Select DebtorNr, UitvoerDat FROM&amp;nbsp; "NBC_e-Connect". dbo.[NBC_QV_HygieneInspectie_B&amp;amp;B] ORDER BY DebtorNr, UitvoerDat;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NoConcatenate&lt;/P&gt;&lt;P&gt;Final:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;'Bez ' &amp;amp; VistNrTemp as VisitNr;&lt;/P&gt;&lt;P&gt;LOAD*,&lt;/P&gt;&lt;P&gt;if(previous(DebtorNr)=DebtorNr and not(IsNull(DebtorNr)),Peek(VistNrTemp)+1,1) as VistNrTemp&lt;/P&gt;&lt;P&gt;Resident Temp&lt;/P&gt;&lt;P&gt;Order by DebtorNr, Date2 asc;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The normal table, each company vertical...&lt;/P&gt;&lt;P&gt;&lt;IMG alt="a1.jpg" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/194019_a1.jpg" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the new cross table:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="a2.jpg" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/194020_a2.jpg" style="height: 316px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perfect Jaume!&lt;/P&gt;&lt;P&gt;Thanks a lot for your help... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 10:57:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44910#M787838</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-02-21T10:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Make visitnumbers from inspectiondates</title>
      <link>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44911#M787839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome! &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Feb 2018 11:02:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Make-visitnumbers-from-inspectiondates/m-p/44911#M787839</guid>
      <dc:creator>jaumecf23</dc:creator>
      <dc:date>2018-02-21T11:02:34Z</dc:date>
    </item>
  </channel>
</rss>

