<?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 Identify repeatable dots on the scatter diagram in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218380#M71524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume it's not really pixels that you care about, as resizing the chart and so on doesn't seem like it should affect whether or not there's a problem deserving an alarm. I assume the marks would be within a certain distance of each other in X &amp;amp; Y terms.&lt;/P&gt;&lt;P&gt;My goal, I think, might be to handle it with color and possibly size. So all the normal marks might be small and gray, but any group of 5 or more in a specific area would turn bright red. Now the trouble is calculating distance. The distances to check are basically the square of the number of points, so let's hope you don't have a large number of points!&lt;/P&gt;&lt;P&gt;I'd calculate distances in the script rather than on the fly in the chart. Then, for each point, I'd count the other points that are close. I'd set a flag based on that count, or possibly just store the count. If you don't need the distances for anything else, drop them.&lt;/P&gt;&lt;P&gt;OK, this sounds doable. I'm going to try it.&lt;/P&gt;&lt;P&gt;OK, see attached application. I'm not sure it's QUITE what you want, in that you could have five points that would fit inside a circle of diameter 5, but none of the points have four other points in that distance. I'm not even sure how you'd go about testing every possible circle of diameter 5, though. There's probably some advanced mathematics way of doing it in a reasonable time frame, but I'm not a mathematician.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Apr 2011 00:30:39 GMT</pubDate>
    <dc:creator>johnw</dc:creator>
    <dc:date>2011-04-16T00:30:39Z</dc:date>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218378#M71522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We are creating a scatter diagram with x &amp;amp; y coordinates to identify the surface marks on glass. If the number of dots within the range the 5 pixels is more than 5 then i need to display the alarm mark on the same scatter diagram. How can we plot this kind of graphs using qlikview.&lt;/P&gt;&lt;P&gt;can you please let me know the solution for this problem asap?&lt;/P&gt;&lt;P&gt;many thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 14:06:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218378#M71522</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-15T14:06:37Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218379#M71523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think this is possible in QV. As far as I know, you can't replace the symbols in a scatter chart. Even if you could somehow manage that, replacing them dynamically would be impossible. However...as of version 10, you can create custom AJAX objects called "QlikView Extensions." In these extensions, you can define a custom chart that will behave however you want. If you need this functionality outside of AJAX, you would need to write a custom OCX object instead of an Extension.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Apr 2011 23:05:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218379#M71523</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2011-04-15T23:05:53Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218380#M71524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume it's not really pixels that you care about, as resizing the chart and so on doesn't seem like it should affect whether or not there's a problem deserving an alarm. I assume the marks would be within a certain distance of each other in X &amp;amp; Y terms.&lt;/P&gt;&lt;P&gt;My goal, I think, might be to handle it with color and possibly size. So all the normal marks might be small and gray, but any group of 5 or more in a specific area would turn bright red. Now the trouble is calculating distance. The distances to check are basically the square of the number of points, so let's hope you don't have a large number of points!&lt;/P&gt;&lt;P&gt;I'd calculate distances in the script rather than on the fly in the chart. Then, for each point, I'd count the other points that are close. I'd set a flag based on that count, or possibly just store the count. If you don't need the distances for anything else, drop them.&lt;/P&gt;&lt;P&gt;OK, this sounds doable. I'm going to try it.&lt;/P&gt;&lt;P&gt;OK, see attached application. I'm not sure it's QUITE what you want, in that you could have five points that would fit inside a circle of diameter 5, but none of the points have four other points in that distance. I'm not even sure how you'd go about testing every possible circle of diameter 5, though. There's probably some advanced mathematics way of doing it in a reasonable time frame, but I'm not a mathematician.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 00:30:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218380#M71524</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-16T00:30:39Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218381#M71525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your data is relatively small, you could try to create a solution in your load script. Something along those lines:&lt;/P&gt;&lt;P&gt;1. Create all possible permutations of 2 "dots" - in essence, a "Cartesian multiplication" of the array of all the dots, multiplied by itself (this is why it only works for small volume of data).&lt;/P&gt;&lt;P&gt;2. For each pair of dots, calculate the distance between the dots = Square root of ( (X1-X2) ^ 2 + (Y1-Y2) ^2 )&lt;/P&gt;&lt;P&gt;3. Reload this table, using GROUP BY, counting the number of "secondary dots" per each "primary dot", where the calculated distance is less than 5&lt;/P&gt;&lt;P&gt;4. Store the counts for each dot.&lt;/P&gt;&lt;P&gt;5. In your scatter chart, color all the dots with a neutral color, and use RED color to emphasize those dots with the count &amp;gt; 5&lt;/P&gt;&lt;P&gt;something like this should work if the size of the data allows...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 00:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218381#M71525</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-04-16T00:31:16Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218382#M71526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently Oleg and I are in psychic communication. &lt;IMG alt="Smile" src="http://community.qlik.com/emoticons/emotion-1.gif" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 00:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218382#M71526</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-16T00:47:32Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218383#M71527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your quick reply John.&lt;/P&gt;&lt;P&gt;If we had written logic on data loading scrips then it will effect the performance of data load time because we are working on millions of records. This calculation logic will be shown on the scatter diagram after applying certain filters. Based on the picture on the diagram, i want to designate the thickly populated dots based on this logic. Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 06:50:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218383#M71527</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-16T06:50:09Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218384#M71528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John - this was funny.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bhami - if you know a way to calculate the distances between all possible dots in the chart, then you can use that condition in determining the dot's color. I can't say that I know an easy way of doing it.&lt;/P&gt;&lt;P&gt;Also, your selections must reduce the data down by A LOT, to enable this kind of calculation in real time.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Apr 2011 19:25:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218384#M71528</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2011-04-16T19:25:35Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218385#M71529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Easy enough to do the exact same calculation in the chart as in the example. Create a data island to hold a copy of the points and coordinates. Count up the points from the island table in range of the real point. If &amp;gt;=5, color it red and make it bigger. Same basic idea, just in the chart.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;QUALIFY *;&lt;BR /&gt;[Island]: LOAD * RESIDENT [Points];&lt;BR /&gt;UNQUALIFY *;&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;background color expression: if(count(if(pow(X-Island.X,2)+pow(Y-Island.Y,2)&amp;lt;6.25,Island.ID))&amp;gt;=5,argb(120,255,0,0),argb(120,0,0,0))&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;z expression: if(count(if(pow(X-Island.X,2)+pow(Y-Island.Y,2)&amp;lt;6.25,Island.ID))&amp;gt;=5,5,1)&lt;/P&gt;&lt;P&gt;Example updated with that.&lt;/P&gt;&lt;P&gt;As Michael says, the more points, the longer this will take to render. You might experiment with performance. If you find that anything over 1000 points causes a serious problem, then set that up as a calculation condition for the chart. Or maybe put a button on the screen that tells them the number of records and estimates the time required to display the chart, and they click it to make the chart display. If they WANT to wait for 5 minutes to see the chart, why stop them? Just make sure they know what they're getting into first. Then probably set it up so that any change in selections removes the chart again. You could handle that by, when they click the button, running a macro that records the current selections. Something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;set field = activedocument.variables("vSelections")&lt;BR /&gt;field.setcontent activedocument.evaluate("getcurrentselections()"),false&lt;/P&gt;&lt;P&gt;Then for the display condition for your chart, something like this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;getcurrentselections()=vSelections&lt;/P&gt;&lt;P&gt;Seems like it would work. They click the button, it records the current selections, they therefore match the current selections, so it shows the chart. Hit clear, change a selection, anything like that, and the current selections will no longer match the variable, so the chart should go away again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 21:25:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218385#M71529</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-18T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218386#M71530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've updated the example with the button approach I mentioned. I've also given a very different solution, using a pivot table to count the number of points within certain ranges. It's not an ideal solution, as you could have a lot of points close together that fall into different classes and thus don't count as a cluster. The main advantage is that it should be very fast. I doubt it would meet your needs, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Apr 2011 21:53:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218386#M71530</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2011-04-18T21:53:44Z</dc:date>
    </item>
    <item>
      <title>Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218387#M71531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John&lt;/P&gt;&lt;P&gt;Excellent solution. This is 100% solution that i am looking for. Many thanks for your help. It works.&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Bhami&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Apr 2011 06:28:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218387#M71531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-19T06:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218388#M71532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asked in a private message how the script speed could be improved for large sets of points. Say we have 1,000,000 data points. That means we have roughly 500,000,000,000 distances to calculate. Clearly brute force isn't going to work. So how can we do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What we need is a way to limit the number of distances we compute. There may be some advanced mathematical way of doing this. As I said, I'm not a mathematician. But here's the first thing that occurred to me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We want to highlight based on a circle of radius five, or a distance of 2.5. So divide the graph into 2.5x2.5 squares. A point can now only be within 2.5 of another point if the other point is in the same or an adjacent square. Join on adjacent squares instead of a Cartesian join. Assuming we don't actually have that many points that close to each other and we're looking for the exceptions, it should load quickly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached example, I used 100,000 points. Our earlier approach would have calculated&amp;nbsp; 10,000,000,000 distances, and so simply wouldn't have worked. With the new approach, it took less than half a minute to load. I'm sure the script can be cleaned up, and I didn't thoroughly test. But even if there are errors and inefficiencies, I suspect the basic idea is sound. For real world data sets with clusters being the exception instead of the rule, I think it should perform just fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 22:30:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218388#M71532</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2013-03-01T22:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218389#M71533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was asked to explain a few things about the example - the big autonumber() expression, how to modify it for other data sets, and what I'm doing when I inner join to 1 as the Flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First thing to note is that I had a bug, and the expression for my example should have been this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,autonumber(text(num(class(X,2.5))+pick(iterno(),-2.5,-2.5,-2.5,&amp;nbsp;&amp;nbsp; 0,0,&amp;nbsp;&amp;nbsp; 0,+2.5,+2.5,+2.5)) &amp;amp; ',' &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; text(num(class(Y,2.5))+pick(iterno(),-2.5,&amp;nbsp;&amp;nbsp; 0,+2.5,-2.5,0,+2.5,-2.5,&amp;nbsp;&amp;nbsp; 0,+2.5))) as Group&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I'd accidentally done squares of 5 on a side instead of 2.5 on a side, which led to comparing more points than necessary. It didn't seem to speed up the 100,000 case, though.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All right. What I'm doing is shown in this picture:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;IMG __jive_id="34770" class="jive-image" alt="PointsInRadius.jpg" src="https://community.qlik.com/legacyfs/online/34770_PointsInRadius.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The class() function here is being used to give me the lower left point of the box that the point is in, so for the point in black (28.125,36.875), it gives us the point (27.5,35). All points in that 2.5x2.5 square will be mapped to (27.5,35). The pick(iterno()) part is just a way of iterating through that square AND the eight surrounding squares.&amp;nbsp; So as we go through nine iterations, we will produce the lower left coordinate of the point's square and all surrounding squares. The autonumber just converts these coordinates to a single integer value. What value is unimportant. All that's important is that it will be consistent, always producing the same integer for the same coordinates. There are simpler ways to write this expression. I just wrote the first way that occurred to me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this expression, the 2.5 is the radius of the circle that you want to check for points within. If you want to check for points within a different radius, you would plug your desired radius into that expression everywhere you see a 2.5. If you want, you could use a variable like vRadius instead. Your X and Y limits for the data set don't have anything to do with it, only the radius.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After flagging distances within this radius with a 1, I then inner join the table with a 1. Since it's an inner join, all this is doing is throwing out all the distances greater than my radius. There's no reason for us to keep those distances, which would probably just slow down the process of adding up the number of points in the radius.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All that said, I started fiddling around with ways to speed it up, and things ended up looking a little different. It now runs about 3x as fast, loading 100,000 points in about 10 seconds, and a million points in about two and a half minutes. Though I should point out that when I loaded a million points, I expanded the range to 2000x2000 to keep clusters relatively rare. Anyway, the script is still the same idea as before, just better tuned, though it's tuned for version 10 64-bit since that's what I have. There are things that I think should run faster a different way (like not recalculating the base Group nine times), but "fixing" them seemed to only slow it down. Hopefully people can figure out what the new script does based on the explanation of the old script, and then tune it for whatever version they're using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the new script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Points]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; recno() as ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,rand()*1000 as X&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,rand()*1000 as Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;AUTOGENERATE 100000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Distances]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NOCONCATENATE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,200000 * floor(X,2.5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + 2 * floor(Y,2.5) as Group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Points]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN ([Distances])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; ID as ID2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,X as X2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,Y as Y2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,200000 * floor(X,2.5) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + 2 * floor(Y,2.5)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; + pick(iterno(),-500005,-500000,-499995,-5,0,5,499995,500000,500005) as Group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Points]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHILE iterno() &amp;lt;= 9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN ([Distances])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD ID,ID2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE ID &amp;lt;&amp;gt; ID2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; AND sqr(X-X2)+sqr(Y-Y2)&amp;lt;=6.25&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN ([Points])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,count(ID2)&amp;gt;=4 as Flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;GROUP BY ID&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Mar 2013 19:16:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218389#M71533</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2013-03-11T19:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: Identify repeatable dots on the scatter diagram</title>
      <link>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218390#M71534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very similar script that lets you plug in a radius as a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET vRad = .005; // The radius that we're checking for points within&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET vRadSquared = sqr($(vRad)); // to save time calculating later&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET vYM = 1 / $(vRad);&amp;nbsp; // to get an integer from our Y coordinate&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&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; // because integers are fast &lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;(edit: won't always be an integer)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LET vXM = vYM * 100000; // to separate the X and Y coordinates&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Points]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD MK,LensPosX as X, LensPosY as Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;FROM Sample.qvd (QVD)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;[Distances]:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// Group into squares with sides equal to the radius&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NOCONCATENATE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD *&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;, $(vXM) * floor(X,$(vRad))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;+ $(vYM) * floor(Y,$(vRad)) as Group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Points]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// Join to same and neighboring groups. All points that are within&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// the radius of each other will be in the same or neighboring groups.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN ([Distances])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MK as MK2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,X as X2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,Y as Y2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;, $(vXM) * floor(X,$(vRad))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;+ $(vYM) * floor(Y,$(vRad))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;+ pick(iterno(),-$(vXM)-$(vYM),-$(vXM),-$(vXM)+$(vYM)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&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; ,-$(vYM),0,+$(vYM)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&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; ,$(vXM)-$(vYM),$(vXM),$(vXM)+$(vYM)) as Group&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Points]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHILE iterno() &amp;lt;= 9&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// Keep only distances &amp;lt;= the radius&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;INNER JOIN ([Distances])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD MK,MK2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;WHERE MK &amp;lt;&amp;gt; MK2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp; AND sqr(X-X2)+sqr(Y-Y2)&amp;lt;= $(vRadSquared)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// Join back to our points, counting distances, which&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// is to say counting the number of points within the &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// radius of this point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LEFT JOIN ([Points])&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;LOAD&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// Flag the point if there are more than 15 points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// within the radius of it (so 17 or more points in&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;// a circle with the given radius).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;,count(MK2)&amp;gt;15 as Flag&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;RESIDENT [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;GROUP BY MK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;DROP TABLE [Distances]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Mar 2013 20:44:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Identify-repeatable-dots-on-the-scatter-diagram/m-p/218390#M71534</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2013-03-15T20:44:59Z</dc:date>
    </item>
  </channel>
</rss>

