<?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: Conditional dimension in chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170695#M21378</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Milosz! Thanks so much for following up!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try to explain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milosz:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;What Count(PeopleID) measure (3rd column) should show in your approach? Count of PeopleID from timestamp X (1st column) or timestamp Y (2nd column) or count/sum/difference from both timestamps (A+B)?&lt;/SPAN&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;Answer: Neither of these &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; In the Count(PeopleID) column, I want to count the number of people that appears in both timestamp X AND timestamp Y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, row 2 in the desired output table refers to row 1 and 3 in the source table.&lt;/P&gt;&lt;P&gt;And row 4 in the desired output table refers to row 4 and 6 in the source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right that there is an error, though. I should have written "Count (&lt;STRONG&gt;Distinct&lt;/STRONG&gt; PeopleID)". The Distinct keyword would ensure that I only count number of unique people in each group of X and Y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milosz:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I think that your example shows wrong value because in source table you have PeopleID=1 for room A in time 3:02 and in second table you show Count(PeopleID) for that room and time =0 ?&lt;/SPAN&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;Answer: It is not wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It's just a difficult case - I think. The first row in the desired output table seeks to count the number of unique people who was present in room A at time 03:02 AND was still present in room A at time 03:04. And that is not true for any of the two people in the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Qlik supported SQL, I would do the following (using 'SourceTable' as my source table):&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;SELECT s1.roomID as RoomTimeX, s2.roomID as RoomTimeY, count(distinct s1.peopleID) as CountDistinctPeopleID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM SourceTable s1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;cross join SourceTable s2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where s1.time='03:02' and s2.time='03:04'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;group by s1.roomID, s2.roomID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it here:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Bilde1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/125221_Bilde1.png" style="height: 178px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;What do you think? Can this be achieved in Qlik?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 May 2016 14:19:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-05-20T14:19:54Z</dc:date>
    <item>
      <title>Conditional dimension in chart</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170691#M21374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear community&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure that what I want is possible. I'd be very interested to hear good suggestions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I want to monitor the flow of people between a number of rooms between two different points in time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example data:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="174" style="border: 1px solid rgb(0, 0, 0); width: 288px; height: 121px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;PeopleID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;RoomID&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Time&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;03:02&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03:03&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03:04&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03:02&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03:03&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;03:04&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I'm interested in the following snapshot times: X = 03:02 and Y = 03:04. (I don't know the time of the snapshot that I'm intersted in when data is loaded.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chart that I want to produce shoud have two dimensions and one measure like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid rgb(0, 0, 0); width: 573px; height: 92px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;RoomID_at_X&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;RoomID_at_Y&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Count(PeopleID)&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;A&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;A&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;B&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(The combinations A,A and B,A don't exist, so they would not be included in the output table. I just included them for illustration.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table is a grouping of the different unique combinations of RoomIDs at the two snapshot times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm struggling with defining the dimensions. I have tried "&lt;SPAN style="color: #333333; font-family: proxima-nova, arial, sans-serif; font-size: 14px;"&gt;If(Time=X, RoomID)" and &lt;SPAN style="font-size: 13.3333px;"&gt;"&lt;/SPAN&gt;&lt;SPAN style="color: #333333; font-family: proxima-nova, arial, sans-serif; font-size: 14px;"&gt;If(Time=Y, RoomID)"&lt;/SPAN&gt;, but this doesn't give me what I need. (Besides, using "if" in this situation seems to be very slow.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all good ideas!&lt;/P&gt;&lt;P&gt;Tor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2016 14:13:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170691#M21374</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-18T14:13:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional dimension in chart</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170692#M21375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that you should use Time and RoomID as dimensions and Count(PeopleID) as measure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the snapshot time (Time field) is too detailed (with minutes and seconds) you can create another filed based on it for example year/month/day/hour (if date is enough just use Date(Time) as calculated dimension).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will provide you to create table object with rooms and dates and number of people in them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: Here you go: I created simple pivot table based on your example data. Please take a look below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="pivot.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/125032_pivot.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Milosz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 11:36:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170692#M21375</guid>
      <dc:creator />
      <dc:date>2016-05-19T11:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional dimension in chart</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170693#M21376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Milosz! However, it's not exactly what I need. Let me be more clear:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The chart needs to have two dimensions (each of which represent a point in time) and one measure (the count).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, if the chart representation is a table, it will have 3 columns: Two columns with the ROOMID at the selected points in time, and one that shows the count.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I can put this into a pivot table or any other chart type or extension as soon as I have been able to achieve this data structure. But my challenge is to write the chart expressions to achieve this data structure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again!&lt;/P&gt;&lt;P&gt;Tor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 12:49:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170693#M21376</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-19T12:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional dimension in chart</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170694#M21377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tor,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What Count(PeopleID) measure (3rd column) should show in your approach? Count of PeopleID from timestamp X (1st column) or timestamp Y (2nd column) or count/sum/difference from both timestamps (A+B)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think that your example shows wrong value because in source table you have PeopleID=1 for room A in time 3:02 and in second table you show Count(PeopleID) for that room and time =0 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my example you can choose 2 points in time and show them for room A, room B - please think about it because it gives you basically what you want. Unless you need difference in people number between two points in time - that will not work both in your approach and mine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="pivot2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/125067_pivot2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Milosz&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2016 13:22:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170694#M21377</guid>
      <dc:creator />
      <dc:date>2016-05-19T13:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional dimension in chart</title>
      <link>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170695#M21378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Milosz! Thanks so much for following up!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me try to explain:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milosz:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;What Count(PeopleID) measure (3rd column) should show in your approach? Count of PeopleID from timestamp X (1st column) or timestamp Y (2nd column) or count/sum/difference from both timestamps (A+B)?&lt;/SPAN&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;Answer: Neither of these &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; In the Count(PeopleID) column, I want to count the number of people that appears in both timestamp X AND timestamp Y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, row 2 in the desired output table refers to row 1 and 3 in the source table.&lt;/P&gt;&lt;P&gt;And row 4 in the desired output table refers to row 4 and 6 in the source table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right that there is an error, though. I should have written "Count (&lt;STRONG&gt;Distinct&lt;/STRONG&gt; PeopleID)". The Distinct keyword would ensure that I only count number of unique people in each group of X and Y.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Milosz:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I think that your example shows wrong value because in source table you have PeopleID=1 for room A in time 3:02 and in second table you show Count(PeopleID) for that room and time =0 ?&lt;/SPAN&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;Answer: It is not wrong &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It's just a difficult case - I think. The first row in the desired output table seeks to count the number of unique people who was present in room A at time 03:02 AND was still present in room A at time 03:04. And that is not true for any of the two people in the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If Qlik supported SQL, I would do the following (using 'SourceTable' as my source table):&lt;/P&gt;&lt;P&gt;&lt;EM style="font-size: 10pt; line-height: 1.5em;"&gt;SELECT s1.roomID as RoomTimeX, s2.roomID as RoomTimeY, count(distinct s1.peopleID) as CountDistinctPeopleID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;FROM SourceTable s1&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;cross join SourceTable s2&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;where s1.time='03:02' and s2.time='03:04'&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;group by s1.roomID, s2.roomID&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tested it here:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Bilde1.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/125221_Bilde1.png" style="height: 178px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;What do you think? Can this be achieved in Qlik?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 May 2016 14:19:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Conditional-dimension-in-chart/m-p/1170695#M21378</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-05-20T14:19:54Z</dc:date>
    </item>
  </channel>
</rss>

