<?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 Is it possible to get a cartesian product in a chart expression? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Is-it-possible-to-get-a-cartesian-product-in-a-chart-expression/m-p/1607263#M45044</link>
    <description>&lt;P&gt;I'm currently trying to create a line chart that will show as a percentage the accumulated number of an event type over the accumulated total of events to date. Basically, on any given date I want to see the percentage of all event types that have occurred up to the given date.&lt;/P&gt;&lt;P&gt;I've attached a .qvf file with sample data to showcase what I mean. For testing purposes, I am just using a straight table that I created. I was able to figure out parts of the problem but then I realized I was missing something.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Straight Table" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/16170iD1EDBFA405539A32/image-size/large?v=v2&amp;amp;px=999" role="button" title="TotalSumToDateTable.PNG" alt="Straight Table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Straight Table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see above, I have a straight table with two dimensions: EventDate and EventType. For each of these I have calculated the accumulated total number of events that have occurred for each event type at each given date and I have calculated the accumulated total number of events for each date. Looking at the first date, you can see that 100% of the event types by that date were 1. For the second date, 50% of the total events were 1, 25% were 3, and 25% were 5. The idea is that you will be able to see how much each event type builds in to the total. And every date should add up to 100%.&lt;/P&gt;&lt;P&gt;The problem that I found was that by 7/23/2019, the expected values should be:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event Type&lt;/TD&gt;&lt;TD&gt;Count to Date&lt;/TD&gt;&lt;TD&gt;Accumulated % of Total&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But instead, I only see Event Type 7 at 20%. In order to get the behavior that I want, I need to repeat every event type that has occurred so far as a dimension. The first thing that came to mind was to have a cartesian join, but on my actual table I am dealing with a lot more dates and a lot more event types, which would result in way too much data. And so I was wondering if it was possible to create a similar effect within a chart? In my chart, there will be a much smaller amount of event types and dates to work with, so I'm not too worried about that.&lt;/P&gt;&lt;P&gt;BONUS: If anyone can tell me why the Total to Date expression sometimes returns the accumulation in the last row instead of the first row, I would appreciate it &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;. The solution I had was to do if(Not IsNull(Top(...)), Top(...), Bottom(...)). It just seems that I'm not understanding something about it.&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 05:07:47 GMT</pubDate>
    <dc:creator>dselgo_eidex</dc:creator>
    <dc:date>2024-11-16T05:07:47Z</dc:date>
    <item>
      <title>Is it possible to get a cartesian product in a chart expression?</title>
      <link>https://community.qlik.com/t5/App-Development/Is-it-possible-to-get-a-cartesian-product-in-a-chart-expression/m-p/1607263#M45044</link>
      <description>&lt;P&gt;I'm currently trying to create a line chart that will show as a percentage the accumulated number of an event type over the accumulated total of events to date. Basically, on any given date I want to see the percentage of all event types that have occurred up to the given date.&lt;/P&gt;&lt;P&gt;I've attached a .qvf file with sample data to showcase what I mean. For testing purposes, I am just using a straight table that I created. I was able to figure out parts of the problem but then I realized I was missing something.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Straight Table" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/16170iD1EDBFA405539A32/image-size/large?v=v2&amp;amp;px=999" role="button" title="TotalSumToDateTable.PNG" alt="Straight Table" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Straight Table&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see above, I have a straight table with two dimensions: EventDate and EventType. For each of these I have calculated the accumulated total number of events that have occurred for each event type at each given date and I have calculated the accumulated total number of events for each date. Looking at the first date, you can see that 100% of the event types by that date were 1. For the second date, 50% of the total events were 1, 25% were 3, and 25% were 5. The idea is that you will be able to see how much each event type builds in to the total. And every date should add up to 100%.&lt;/P&gt;&lt;P&gt;The problem that I found was that by 7/23/2019, the expected values should be:&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Event Type&lt;/TD&gt;&lt;TD&gt;Count to Date&lt;/TD&gt;&lt;TD&gt;Accumulated % of Total&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But instead, I only see Event Type 7 at 20%. In order to get the behavior that I want, I need to repeat every event type that has occurred so far as a dimension. The first thing that came to mind was to have a cartesian join, but on my actual table I am dealing with a lot more dates and a lot more event types, which would result in way too much data. And so I was wondering if it was possible to create a similar effect within a chart? In my chart, there will be a much smaller amount of event types and dates to work with, so I'm not too worried about that.&lt;/P&gt;&lt;P&gt;BONUS: If anyone can tell me why the Total to Date expression sometimes returns the accumulation in the last row instead of the first row, I would appreciate it &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;. The solution I had was to do if(Not IsNull(Top(...)), Top(...), Bottom(...)). It just seems that I'm not understanding something about it.&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 05:07:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Is-it-possible-to-get-a-cartesian-product-in-a-chart-expression/m-p/1607263#M45044</guid>
      <dc:creator>dselgo_eidex</dc:creator>
      <dc:date>2024-11-16T05:07:47Z</dc:date>
    </item>
  </channel>
</rss>

