<?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: How to make this IF statement for Calculated Dimension efficient in the script? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106778#M7273</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Pick(Match(SourceOrigin,'Warehouse','Store'), CurrencyA, CurrencyB)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Aug 2018 15:06:17 GMT</pubDate>
    <dc:creator>BalaBhaskar_Qlik</dc:creator>
    <dc:date>2018-08-21T15:06:17Z</dc:date>
    <item>
      <title>How to make this IF statement for Calculated Dimension efficient in the script?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106777#M7272</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 an IF statement for a calculated dimension:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(SourceOrigin = 'Warehouse' or SourceOrigin = 'Store', CurrencyA,&lt;/P&gt;&lt;P&gt;If(SourceOrigin = 'Online', CurrencyB))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I write this efficiently in the script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CurrencyA, and Currency B are in seperate tables so I cannot copy the IF statement back to the script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:43:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106777#M7272</guid>
      <dc:creator>jblomqvist</dc:creator>
      <dc:date>2018-08-21T14:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to make this IF statement for Calculated Dimension efficient in the script?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106778#M7273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=Pick(Match(SourceOrigin,'Warehouse','Store'), CurrencyA, CurrencyB)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:06:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106778#M7273</guid>
      <dc:creator>BalaBhaskar_Qlik</dc:creator>
      <dc:date>2018-08-21T15:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to make this IF statement for Calculated Dimension efficient in the script?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106779#M7274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are both tables related based on the column SourceOrigin?&lt;/P&gt;&lt;P&gt;Is it possible for you to share a screenshot of your data model&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106779#M7274</guid>
      <dc:creator>vamsee</dc:creator>
      <dc:date>2018-08-21T15:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to make this IF statement for Calculated Dimension efficient in the script?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106780#M7275</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;The two tables are not related based on the column SourceOrigin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no direct relationship of the two tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The two tables are linked via a middle man table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wrote the IF statement like this in the script where SourceOrigin resides:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=IF(SourceOrigin = 'Warehouse' or SourceOrigin = 'Store', 1,&lt;/P&gt;&lt;P&gt;If(SourceOrigin = 'Online', 0)) as FIeldFlag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then in the UI for a Calculated Dimension an IF statement that is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF(FieldFlag = 1, CurrencyA, If(FieldFlag = 0, CurrencyB))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if this is more efficient but this is what I can think of.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 15:45:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106780#M7275</guid>
      <dc:creator>jblomqvist</dc:creator>
      <dc:date>2018-08-21T15:45:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to make this IF statement for Calculated Dimension efficient in the script?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106781#M7276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could do this in script by selecting the data from the RESIDENT tables and append the field to maybe your link table.&lt;/P&gt;&lt;P&gt;You would use your original IF after selecting/joining from the already loaded tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[Temp]:&lt;/P&gt;&lt;P&gt;LOAD Key, CurrencyA &lt;/P&gt;&lt;P&gt;RESIDENT Table1;&lt;/P&gt;&lt;P&gt;JOIN&lt;/P&gt;&lt;P&gt;LOAD Key, SourceOrigin&lt;/P&gt;&lt;P&gt;RESIDENT LinkTable;&lt;/P&gt;&lt;P&gt;JOIN &lt;/P&gt;&lt;P&gt;LOAD Key, CurrencyB&lt;/P&gt;&lt;P&gt;RESIDENT Table2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[final]:&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;IF(SourceOrigin = 'Warehouse' or SourceOrigin = 'Store', CurrencyA,&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;If(SourceOrigin = 'Online', CurrencyB))&lt;/P&gt;&lt;P&gt;RESIDENT Temp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Drop table Temp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2018 18:16:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-make-this-IF-statement-for-Calculated-Dimension-efficient/m-p/106781#M7276</guid>
      <dc:creator>dwforest</dc:creator>
      <dc:date>2018-08-21T18:16:53Z</dc:date>
    </item>
  </channel>
</rss>

