<?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: Comparing TimeStamps / Set Analysis in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926568#M76298</link>
    <description>&lt;P&gt;&lt;EM&gt;Avg(aggr({&amp;lt;agent_name_CallLog={*}&amp;gt;} count({&amp;lt;&lt;STRONG&gt;CallDateTime_CallLog={"&amp;lt;=$(=AGGR[First Human Contact Date])"}&lt;/STRONG&gt;&amp;gt;} distinct call_id),contact_id_Master))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This comparison doesn't seem right&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;CallDateTime_CallLog &amp;lt; =[First Human Contact Date])&amp;nbsp;&lt;SPAN&gt;??&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;[First Human Contact Date]&lt;/STRONG&gt; is already your smallest value, how would any other&amp;nbsp; &lt;STRONG&gt;CallDateTime_CallLog&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;record be smaller than&lt;STRONG&gt;&amp;nbsp;[First Human Contact Date] ?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Can you explain what exactly you are trying to evaluate i.e&amp;nbsp; the business definition of this KPI&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;[First Human Contact Date] &lt;/STRONG&gt;can be different for each&amp;nbsp;&lt;STRONG&gt;contact_id_Master, t&lt;/STRONG&gt;herefore evaluating this in set analysis is not possible&amp;nbsp; a&lt;STRONG&gt;s the expression will evaluate once for the entire chart and not each contact_id_Master&lt;/STRONG&gt; row in the chart&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I suggest you create new fields in your load script&amp;nbsp;&lt;EM&gt;[First Human Contact Date]&lt;SPAN&gt;&amp;nbsp; , and a flagfield that does the comparison&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load * Dataset;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Left Join(Temp)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load&amp;nbsp;contact_id_Master&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Min(CallDateTime_CallLog&amp;nbsp;) as [First Human Contact Date]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Resident Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;Load *,if(&lt;EM&gt;condition,true then 1,else 0) as flagfield&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Resident&amp;nbsp;&lt;EM&gt;Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then expression&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;count({&amp;lt;agent_name_CallLog={*}, flagfield={'1'} &amp;gt;}distinct call_id)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 05 May 2022 03:12:35 GMT</pubDate>
    <dc:creator>vinieme12</dc:creator>
    <dc:date>2022-05-05T03:12:35Z</dc:date>
    <item>
      <title>Comparing TimeStamps / Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926523#M76290</link>
      <description>&lt;P&gt;Good afternoon,&lt;BR /&gt;&lt;BR /&gt;I am hoping to receive some help.&amp;nbsp; I am trying to determine an average for number of calls it takes an agent to receive human contact for the first time.&amp;nbsp;I believe I either have a syntax error with set analysis, or somewhere along the way an AGGR function is being misused.&lt;BR /&gt;&lt;BR /&gt;The key field I am working with is CallDateTime_CallLog which is a timestamp. I am also working with a master item [First Human Contact Date] defined by the following code,&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;AGGR({&amp;lt;agent_name_CallLog={*}&amp;gt;} Min(CallDateTime_CallLog),contact_id_Master)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Below is one of two main lines of code I am trying to resolve (which makes use of the master item) :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Avg(aggr({&amp;lt;agent_name_CallLog={*}&amp;gt;} count({&amp;lt;CallDateTime_CallLog={"&amp;lt;=$(=AGGR[First Human Contact Date])"}&amp;gt;} distinct call_id),contact_id_Master))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The above code simply gives me the total number of calls for each contact_id_Master.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The below syntax works only when a single contact_id_Master has been selected, and gives us the correct number.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;Avg(aggr(count({&amp;lt;CallDateTime_CallLog ={"&amp;lt;=$(=AGGR(Min({&amp;lt;agent_name_CallLog {*}&amp;gt;}CallDateTime_CallLog),contact_id_Master))"}&amp;gt;} distinct call_id),contact_id_Master))&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I notice issues with the comparison operation between the two timestamps. Issue being I can seem to swap &amp;lt;= to &amp;gt;= with no change.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am relatively new to Qlik and hope this was a suitable first post.&amp;nbsp; Any guidance in what is wrong here, or a proper direction to take would be appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I also considered the need for using a StructuredParameter with an aggr function, but no success there, and not entirely sure if I am receiving the single variable I am hoping to receive for the comparison, or a list.&amp;nbsp; Again, stand alone, the master item provides the proper timestamp.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 20:08:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926523#M76290</guid>
      <dc:creator>hudam</dc:creator>
      <dc:date>2022-05-04T20:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing TimeStamps / Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926568#M76298</link>
      <description>&lt;P&gt;&lt;EM&gt;Avg(aggr({&amp;lt;agent_name_CallLog={*}&amp;gt;} count({&amp;lt;&lt;STRONG&gt;CallDateTime_CallLog={"&amp;lt;=$(=AGGR[First Human Contact Date])"}&lt;/STRONG&gt;&amp;gt;} distinct call_id),contact_id_Master))&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This comparison doesn't seem right&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;CallDateTime_CallLog &amp;lt; =[First Human Contact Date])&amp;nbsp;&lt;SPAN&gt;??&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;[First Human Contact Date]&lt;/STRONG&gt; is already your smallest value, how would any other&amp;nbsp; &lt;STRONG&gt;CallDateTime_CallLog&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;record be smaller than&lt;STRONG&gt;&amp;nbsp;[First Human Contact Date] ?&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Can you explain what exactly you are trying to evaluate i.e&amp;nbsp; the business definition of this KPI&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;[First Human Contact Date] &lt;/STRONG&gt;can be different for each&amp;nbsp;&lt;STRONG&gt;contact_id_Master, t&lt;/STRONG&gt;herefore evaluating this in set analysis is not possible&amp;nbsp; a&lt;STRONG&gt;s the expression will evaluate once for the entire chart and not each contact_id_Master&lt;/STRONG&gt; row in the chart&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;I suggest you create new fields in your load script&amp;nbsp;&lt;EM&gt;[First Human Contact Date]&lt;SPAN&gt;&amp;nbsp; , and a flagfield that does the comparison&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load * Dataset;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Left Join(Temp)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Load&amp;nbsp;contact_id_Master&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Min(CallDateTime_CallLog&amp;nbsp;) as [First Human Contact Date]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Resident Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Final:&lt;/P&gt;
&lt;P&gt;Load *,if(&lt;EM&gt;condition,true then 1,else 0) as flagfield&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Resident&amp;nbsp;&lt;EM&gt;Temp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then expression&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;count({&amp;lt;agent_name_CallLog={*}, flagfield={'1'} &amp;gt;}distinct call_id)&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 03:12:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926568#M76298</guid>
      <dc:creator>vinieme12</dc:creator>
      <dc:date>2022-05-05T03:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing TimeStamps / Set Analysis</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926769#M76315</link>
      <description>&lt;P&gt;Vineeth,&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the informative response.&amp;nbsp; I am going to be working on implementing the suggestions you gave.&amp;nbsp; I provided some more explanation below to ensure there is clarity.&amp;nbsp; I will hopefully resolve my issue today thanks to this response and will mark your response as 'solution' at that time.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a call has 'human contact' if the agent_name_CallLog field is not null.&amp;nbsp; So for each contact_id_Master I am wanting to find how many calls it took until we made 'human contact' (I want to count all calls for each contact_id_Master up until and including the first call that has agent_name_CallLog populated).&amp;nbsp; &amp;nbsp; Master and CallLog are separate tables.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;For the Master Item in place [First Human Contact] ; I was thinking my logic there was grabbing me the earliest date that has human contact - thus, there would potentially be calls preceding it without human contact that I would want to count.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;But it sounds like I need to get a better understanding of the applicability of set analysis and when to use that vs. load editor.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moving to operating in the load editor was my next move, so I appreciate the insight on why set analysis would not work for this matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 May 2022 10:00:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-TimeStamps-Set-Analysis/m-p/1926769#M76315</guid>
      <dc:creator>hudam</dc:creator>
      <dc:date>2022-05-05T10:00:38Z</dc:date>
    </item>
  </channel>
</rss>

