<?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: Do I use sets, IF statement, or something else? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773494#M1032225</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you created two System tables (System of Origin &amp;amp; System of Destination) without any interconnection, then you are probably trying to calculate the big Cartesian Product with that expression. What you can do is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a listbox with the name of the System Of Origin&lt;/LI&gt;&lt;LI&gt;Create a Straight Table with a conditional show that hides the table if there is &lt;EM&gt;more than one&lt;/EM&gt; selected/possible value in the listbox System Of Origin. Use an expression like GetSelectedCount([unq:name]) = 1&lt;/LI&gt;&lt;LI&gt;In the straight table, select System Of Destination (name) as only dimension.&lt;/LI&gt;&lt;LI&gt;Add an expression that calculates: =IF(sqrt(...) &amp;lt;=:$(vRange), sqrt()). Replace sqrt() with your distance calculation expression, and vRange with the name of the variable that contains your range value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Jan 2015 13:35:04 GMT</pubDate>
    <dc:creator>Peter_Cammaert</dc:creator>
    <dc:date>2015-01-27T13:35:04Z</dc:date>
    <item>
      <title>Do I use sets, IF statement, or something else?</title>
      <link>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773493#M1032224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Background:&lt;/P&gt;&lt;P&gt;I play a game called 'Elite:Dangerous' which involves flying around space, trading between space stations (and some shooting)&lt;/P&gt;&lt;P&gt;I thought I'd try to expand my knowledge of Qlikview by putting the data I have on some of the star systems and space stations in the game.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have two lists of star systems (System of Origin and System) - these are essentially the same list, but with different field names so I can look at 'where I am' and 'where I'm going to'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each System also has a Station, and at each Station there is a Item list, with association Buy and Sell values.&lt;/P&gt;&lt;P&gt;Each system also has an X/POZ,Y/POY,Z/POZ coordinate (for System or System of Origin accordingly).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I calculate the distance between system1 and system2 using their respective xyz coordinate:&lt;/P&gt;&lt;P&gt;=sqrt(((X-POX)*(X-POX))+((Y-POY)*(Y-POY))+((Z-POZ)*(Z-POZ)))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have added a field called Range which simply contains a value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to display is all the Systems within xRange of my System of Origin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I do this?&lt;/P&gt;&lt;P&gt;I've tried sets and I've tried If statements, both locked up qlikview and my computer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The CSVs are exported from another program, and this is the format they come out in, so I'm unwilling to change these (as the data is updated regularly)- I have attached the relevant csvs, and also my loadscript (I am aware of the typo in the loadscript loading one field as aStation instead of Station - I have corrected this in my qlikview.).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[NOTE]&lt;/P&gt;&lt;P&gt;I'm on the personal edition so can't open any qlickview files you attach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for your help and advice.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 12:11:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773493#M1032224</guid>
      <dc:creator />
      <dc:date>2015-01-27T12:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Do I use sets, IF statement, or something else?</title>
      <link>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773494#M1032225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you created two System tables (System of Origin &amp;amp; System of Destination) without any interconnection, then you are probably trying to calculate the big Cartesian Product with that expression. What you can do is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a listbox with the name of the System Of Origin&lt;/LI&gt;&lt;LI&gt;Create a Straight Table with a conditional show that hides the table if there is &lt;EM&gt;more than one&lt;/EM&gt; selected/possible value in the listbox System Of Origin. Use an expression like GetSelectedCount([unq:name]) = 1&lt;/LI&gt;&lt;LI&gt;In the straight table, select System Of Destination (name) as only dimension.&lt;/LI&gt;&lt;LI&gt;Add an expression that calculates: =IF(sqrt(...) &amp;lt;=:$(vRange), sqrt()). Replace sqrt() with your distance calculation expression, and vRange with the name of the variable that contains your range value&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 13:35:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773494#M1032225</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-01-27T13:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Do I use sets, IF statement, or something else?</title>
      <link>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773495#M1032226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Exactly what was after.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Jan 2015 15:57:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Do-I-use-sets-IF-statement-or-something-else/m-p/773495#M1032226</guid>
      <dc:creator />
      <dc:date>2015-01-27T15:57:14Z</dc:date>
    </item>
  </channel>
</rss>

