<?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: Need to Compared IDs between two Weeks, Month in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710238#M1055089</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you example, I tried the logic you have given me, I have created a straight table, and if you see that the positive 1's or my addition (ie a new patient and a patient whos was already with us but for some reason left and again rejoined that is also considered as add .. and all those negative 1s or my drops.&lt;/P&gt;&lt;P&gt;When I compared the STATUS field as per your code it does give me those patients ideally according to my result attached 7 should be my additions and 3 are my drops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please have a look at the qvw file attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Oct 2014 05:46:03 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-10-29T05:46:03Z</dc:date>
    <item>
      <title>Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710234#M1055085</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 a field with Patient ID and a field with Date, need to compare the Patient ID whether it is available prior week, if it is not there then it is consider as my new add, similarly I compare it with the prior week with the current week if any patient IDs are missing then it is considered as drops.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached an excel with a vlookup comparing two weeks, I need the count of add and drop, I am not successful in achieving this in QV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help, if you could give an example it would be great&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;Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 10:52:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710234#M1055085</guid>
      <dc:creator />
      <dc:date>2014-10-28T10:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710235#M1055086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should start off firstly by importing the data as per below, you should assign each patient id a particular week e,g&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Table_1:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;LOAD&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;filebasename&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() &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;FileName&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;PATIENT_ID,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;WEEK&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;FROM&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;Test.csv (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ansi&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;txt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;delimiter&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;is&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; ',', &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;embedded&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;labels&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;msq&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;);&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Once done you will be able to get the data in a chart and make comparisons as to whether on patient ID exists in one week and not the other.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;This could also be done by creating 2 seperate tables in Qlikview for each week you want to compare.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;AIdan&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 11:53:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710235#M1055086</guid>
      <dc:creator />
      <dc:date>2014-10-28T11:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710236#M1055087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Aldan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to know how many adds for the current week and drops for the previous week, and further drill down it should give me the list of Patient ID who are missing and are new addition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you please help me how would you compare the patient ID in a chart, I have used an expression to get the result but it partially working, I have also attached a qv document&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help&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;Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 13:04:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710236#M1055087</guid>
      <dc:creator />
      <dc:date>2014-10-28T13:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710237#M1055088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arjun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at this load statement, i've done it for you as example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached files you can see the source document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CODE_TO_COPY:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;/P&gt;&lt;P&gt;STATEMENT STEPS:&lt;/P&gt;&lt;P&gt;- Load data from source xlsx file and extract useful dimensions from date field&lt;/P&gt;&lt;P&gt;- Generate Variables to set the Mapping LOAD statement wich load specific PATIENT_ID From First Source Table&lt;/P&gt;&lt;P&gt;- Mapping LOAD statements: flag PATIENT_ID under specifc queries (YEAR + WEEK)&lt;/P&gt;&lt;P&gt;- Append mapping fields in source table&lt;/P&gt;&lt;P&gt;- Generate "STATUS" Field as a result of the flags combinations&lt;/P&gt;&lt;P&gt;*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempPatient1:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; PATIENT_ID,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Year(DATE)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as YEAR&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Num(Month(DATE))&amp;nbsp; as MONTH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Num(WeekDay(DATE)) as DAY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Num(Week(DATE))&amp;nbsp;&amp;nbsp;&amp;nbsp; as WEEK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Date(WeekStart(DATE),'DD/MM/YYYY') as WEEK_START_DATE&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Date(DATE,'YYYY')&amp;amp;Num(Week(DATE))&amp;amp;Num(WeekDay(DATE)) as DATE_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[Patient.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is Foglio1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LastWeek:&lt;/P&gt;&lt;P&gt;LOAD&amp;nbsp; Max(DATE_ID) as MAX_DATE_ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,Max(YEAR)&amp;nbsp;&amp;nbsp;&amp;nbsp; as MAX_YEAR&lt;/P&gt;&lt;P&gt;Resident TempPatient1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vMaxWeek = Mid(Peek('MAX_DATE_ID',0,'LastWeek'),5,2);&lt;/P&gt;&lt;P&gt;LET vMaxYear = Peek('MAX_YEAR',0,'LastWeek');&lt;/P&gt;&lt;P&gt;LET vPreviousWeek = $(vMaxWeek)-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table LastWeek;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CurrentPatient:&lt;/P&gt;&lt;P&gt;Mapping LOAD&amp;nbsp; PATIENT_ID,'1'&lt;/P&gt;&lt;P&gt;Resident TempPatient1&lt;/P&gt;&lt;P&gt;Where YEAR=$(vMaxYear) and WEEK=$(vMaxWeek);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PreviousWeekPatient:&lt;/P&gt;&lt;P&gt;Mapping LOAD&amp;nbsp; PATIENT_ID,'1'&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Resident TempPatient1&lt;/P&gt;&lt;P&gt;Where YEAR=$(vMaxYear) and WEEK=$(vPreviousWeek);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempPatient2:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;,ApplyMap('CurrentPatient',PATIENT_ID,0)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as CurrentPatientFlag&lt;/P&gt;&lt;P&gt;,ApplyMap('PreviousWeekPatient',PATIENT_ID,0)&amp;nbsp;&amp;nbsp;&amp;nbsp; as PreviousWeekPatientFlag&lt;/P&gt;&lt;P&gt;Resident TempPatient1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table TempPatient1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patient:&lt;/P&gt;&lt;P&gt;LOAD &lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;,if(CurrentPatientFlag=1 and PreviousWeekPatientFlag=0&lt;/P&gt;&lt;P&gt;,'New'&lt;/P&gt;&lt;P&gt;&amp;nbsp; ,if(CurrentPatientFlag=1 and PreviousWeekPatientFlag=1&lt;/P&gt;&lt;P&gt;, 'Old'&lt;/P&gt;&lt;P&gt;,'Resign'))&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; as STATUS&lt;/P&gt;&lt;P&gt;Resident TempPatient2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop Table TempPatient2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Oct 2014 15:31:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710237#M1055088</guid>
      <dc:creator />
      <dc:date>2014-10-28T15:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710238#M1055089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for you example, I tried the logic you have given me, I have created a straight table, and if you see that the positive 1's or my addition (ie a new patient and a patient whos was already with us but for some reason left and again rejoined that is also considered as add .. and all those negative 1s or my drops.&lt;/P&gt;&lt;P&gt;When I compared the STATUS field as per your code it does give me those patients ideally according to my result attached 7 should be my additions and 3 are my drops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please have a look at the qvw file attached&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 05:46:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710238#M1055089</guid>
      <dc:creator />
      <dc:date>2014-10-29T05:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710239#M1055090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi arjun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PFA ,I hope it help to u.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 05:47:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710239#M1055090</guid>
      <dc:creator>perumal_41</dc:creator>
      <dc:date>2014-10-29T05:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need to Compared IDs between two Weeks, Month</title>
      <link>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710240#M1055091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Perumal &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much it worked perfect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Arjun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Oct 2014 11:47:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Need-to-Compared-IDs-between-two-Weeks-Month/m-p/710240#M1055091</guid>
      <dc:creator />
      <dc:date>2014-10-29T11:47:27Z</dc:date>
    </item>
  </channel>
</rss>

