<?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: Find price in same session in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570703#M479275</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doesn't the solution from this post &lt;A href="https://community.qlik.com/thread/106547"&gt;How to show sum based on a type in an event&lt;/A&gt; work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(if(substringcount(concat(EventType, ','),'itemclick')&amp;gt;0,sum({&amp;lt;EventType={'buy'}&amp;gt;}Price)),sessionid))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Feb 2014 19:55:58 GMT</pubDate>
    <dc:creator>Nicole-Smith</dc:creator>
    <dc:date>2014-02-11T19:55:58Z</dc:date>
    <item>
      <title>Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570702#M479274</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 problem - See attached for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basic thing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need the Price when there is an eventtype called Buy, but they also have an eventtype called Itemclick - They should be within same session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As it is now it shows me the price for a visit - I dont want that - It should only be on the buys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RowID, CreateDate,EventType,Price, sessionid&lt;/P&gt;&lt;P&gt;1, 2014-02-02, itemclick, 0, 12121&lt;/P&gt;&lt;P&gt;2,2014-02-02,visit,203,12121&lt;/P&gt;&lt;P&gt;3,2014-02-02,buy,205,12121&lt;/P&gt;&lt;P&gt;4,2014-02-02,buy,202,12121&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then my price should be seen on both and total should be 407.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 19:52:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570702#M479274</guid>
      <dc:creator />
      <dc:date>2014-02-11T19:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570703#M479275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Doesn't the solution from this post &lt;A href="https://community.qlik.com/thread/106547"&gt;How to show sum based on a type in an event&lt;/A&gt; work for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum(aggr(if(substringcount(concat(EventType, ','),'itemclick')&amp;gt;0,sum({&amp;lt;EventType={'buy'}&amp;gt;}Price)),sessionid))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 19:55:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570703#M479275</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-02-11T19:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570704#M479276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; It does not take all values. Sometimes it leaves out some, and it shows the price based on the wrong eventtype&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 19:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570704#M479276</guid>
      <dc:creator />
      <dc:date>2014-02-11T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570705#M479277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As u can see in the attached it sums randomly it looks like? sometimes it sums on Visit also. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 19:58:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570705#M479277</guid>
      <dc:creator />
      <dc:date>2014-02-11T19:58:57Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570706#M479278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You've added more dimensions to that chart than are in the aggr(), so you need to also add those to the aggr(), then you have to use total in the concat() but still take into account the session:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;=sum(aggr(if(substringcount(concat(total &amp;lt;SessionIDINT&amp;gt; EventType, ','),'Itemclick')&amp;gt;0,sum({&amp;lt;EventType={'Buy'}&amp;gt;}PriceCleansed)),Hour2,Minute2,Date_Clean,SessionIDINT,EventType))&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 20:11:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570706#M479278</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-02-11T20:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570707#M479279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks! Youre good &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 20:40:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570707#M479279</guid>
      <dc:creator />
      <dc:date>2014-02-11T20:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570708#M479280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know if there is a faster way to do this? The expression is quite slow!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 21:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570708#M479280</guid>
      <dc:creator />
      <dc:date>2014-02-11T21:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570709#M479281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flagging the values you want to add in the load script, and then just using plain set analysis to get the sum (instead of the if statement and the aggr).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 21:09:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570709#M479281</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-02-11T21:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570710#M479282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you flag them in the load script based on the same logic? That an itemclick and buy happens within same session?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Feb 2014 21:12:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570710#M479282</guid>
      <dc:creator />
      <dc:date>2014-02-11T21:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Find price in same session</title>
      <link>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570711#M479283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Load script (Hej was the name of the table in your example--if it's actually a different name in the real file, you'll need to change the name here):&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;LEFT JOIN (Hej)&lt;/P&gt;
&lt;P&gt;LOAD DISTINCT&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SessionIDINT,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Buy' as EventType,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 as RevenueFlag&lt;/P&gt;
&lt;P&gt;RESIDENT Hej&lt;/P&gt;
&lt;P&gt;WHERE match(EventType,'Itemclick');&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the expression on your chart is simply:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;
&lt;P&gt;sum({&amp;lt;RevenueFlag={1}&amp;gt;}PriceCleansed)&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 14:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-price-in-same-session/m-p/570711#M479283</guid>
      <dc:creator>Nicole-Smith</dc:creator>
      <dc:date>2014-02-12T14:18:09Z</dc:date>
    </item>
  </channel>
</rss>

