<?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 Island dimension in a table, expression avoiding an IF?! in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504131#M188425</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Bit of a strange one this. We have an island dimension, which has the same values as some column names in the fact table.&lt;/P&gt;&lt;P&gt;The simple reason being the dataset is 65,000,000 rows and having this dimension as an additional column would potentially increase this by 20 times!!&lt;/P&gt;&lt;P&gt;Therefore under the advice of qliktech we created the island dimension, and renamed the amount columns with the same values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this as a basic example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Island Table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="229" style="border: 1px solid rgb(0, 0, 0); width: 87px; height: 230px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;cost_type&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;BLOOD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DRUGS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;WARDS AND NURSING&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;IMPLANTS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact Table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="100" style="border: 1px solid rgb(0, 0, 0); width: 456px; height: 90px;"&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;Header 1&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;Header 2&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;Header 3&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;Header 4&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;Header 5&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;HRG&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;BLOOD&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DRUGS&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;WARDS AND NURSING&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;IMPLANTS&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;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;40&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23&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;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;456&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the whole this works very well for us, the only issue being when we want to create a table with this dimension, the only way we've found to add the expression is a large IF statement, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13769875624217795" jivemacro_uid="_13769875624217795"&gt;
&lt;P&gt;=&lt;/P&gt;
&lt;P&gt;if(cost_type='BLOOD',sum(BLOOD),&lt;/P&gt;
&lt;P&gt;if(cost_type='DRUGS',sum(DRUGS),&lt;/P&gt;
&lt;P&gt;if(cost_type='WARDS AND NURSING',sum([WARDS AND NURSING]),&lt;/P&gt;
&lt;P&gt;IF(cost_type='IMPLANTS',SUM(IMPLANTS),0))))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is obviously an incredibly slow way for the system to calculate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simple way to include the dimension in the formula?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping something like this would work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="_jivemacro_uid_1376987643210632 jive_text_macro jive_macro_code" jivemacro_uid="_1376987643210632"&gt;
&lt;P&gt;=sum('['&amp;amp;cost_type&amp;amp;']')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Aug 2013 08:35:09 GMT</pubDate>
    <dc:creator>adamdavi3s</dc:creator>
    <dc:date>2013-08-20T08:35:09Z</dc:date>
    <item>
      <title>Island dimension in a table, expression avoiding an IF?!</title>
      <link>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504131#M188425</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Bit of a strange one this. We have an island dimension, which has the same values as some column names in the fact table.&lt;/P&gt;&lt;P&gt;The simple reason being the dataset is 65,000,000 rows and having this dimension as an additional column would potentially increase this by 20 times!!&lt;/P&gt;&lt;P&gt;Therefore under the advice of qliktech we created the island dimension, and renamed the amount columns with the same values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider this as a basic example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Island Table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="229" style="border: 1px solid rgb(0, 0, 0); width: 87px; height: 230px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;cost_type&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;BLOOD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;DRUGS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;WARDS AND NURSING&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;IMPLANTS&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fact Table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="100" style="border: 1px solid rgb(0, 0, 0); width: 456px; height: 90px;"&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;Header 1&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;Header 2&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;Header 3&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;Header 4&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;Header 5&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;HRG&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;BLOOD&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;DRUGS&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;WARDS AND NURSING&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;IMPLANTS&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;100&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;20&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;40&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;23&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;200&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;10&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;50&lt;/TD&gt;&lt;TD style="padding: 2px;"&gt;456&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On the whole this works very well for us, the only issue being when we want to create a table with this dimension, the only way we've found to add the expression is a large IF statement, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13769875624217795" jivemacro_uid="_13769875624217795"&gt;
&lt;P&gt;=&lt;/P&gt;
&lt;P&gt;if(cost_type='BLOOD',sum(BLOOD),&lt;/P&gt;
&lt;P&gt;if(cost_type='DRUGS',sum(DRUGS),&lt;/P&gt;
&lt;P&gt;if(cost_type='WARDS AND NURSING',sum([WARDS AND NURSING]),&lt;/P&gt;
&lt;P&gt;IF(cost_type='IMPLANTS',SUM(IMPLANTS),0))))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is obviously an incredibly slow way for the system to calculate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a simple way to include the dimension in the formula?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was hoping something like this would work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="_jivemacro_uid_1376987643210632 jive_text_macro jive_macro_code" jivemacro_uid="_1376987643210632"&gt;
&lt;P&gt;=sum('['&amp;amp;cost_type&amp;amp;']')&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it doesn't&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 08:35:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504131#M188425</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2013-08-20T08:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Island dimension in a table, expression avoiding an IF?!</title>
      <link>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504132#M188426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try a pick-match combination:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=pick(match(cost_type,'BLOOD','DRUGS','WARDS AND NURSING','IMPLANTS'),&lt;/P&gt;&lt;P&gt;sum(BLOOD),&lt;/P&gt;&lt;P&gt;sum(DRUGS),&lt;/P&gt;&lt;P&gt;sum([WARDS AND NURSING]),&lt;/P&gt;&lt;P&gt;sum(IMPLANTS))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the smart way is to use the CrossTable function in the script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD @1 as cost_type&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;comm89620.xls&lt;/P&gt;&lt;P&gt;(biff, no labels, table is cost_types$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrossTable(cost_type, value)&lt;/P&gt;&lt;P&gt;LOAD HRG, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BLOOD, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DRUGS, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [WARDS AND NURSING], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPLANTS&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;comm89620.xls&lt;/P&gt;&lt;P&gt;(biff, embedded labels, table is fact$);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can then use cost_type as dimension and sum(value) as expression. See attached qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Aug 2013 16:46:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504132#M188426</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-08-20T16:46:53Z</dc:date>
    </item>
    <item>
      <title>Re: Island dimension in a table, expression avoiding an IF?!</title>
      <link>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504133#M188427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I didn't get my usual email to tell me this reply was here!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try the pick match and see if it runs better than the IF statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The cross-table unfortunately isn't viable due to the volumes of data!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 11:59:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504133#M188427</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2013-08-26T11:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Island dimension in a table, expression avoiding an IF?!</title>
      <link>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504134#M188428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pick match improved the speed 4 fold &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;10 seconds down to 2.5 on my larger data set.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2013 12:37:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Island-dimension-in-a-table-expression-avoiding-an-IF/m-p/504134#M188428</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2013-08-26T12:37:19Z</dc:date>
    </item>
  </channel>
</rss>

