<?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 Restricted Keyfigures ('If select' statement across multiple tables) in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232541#M84143</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QV Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make an if statement across multiple tabels.&lt;/P&gt;&lt;P&gt;How can I solve this? This is a SAP BW cube, so it means Fact Table, Dimension Table and Attribute Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// if([Condition type_KSCHL]='YA01', [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exchange rate_EXCHG_RATE]) as 'Restricted Keyfigure_YA01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keyfigures:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %ZNSD_C161_KEY,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX],&lt;BR /&gt; [Exchange rate_EXCHG_RATE]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Dimension:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; [Dimension Key_DIMID] as %ZNSD_C161_KEY,&lt;BR /&gt; [SID_SID_0KSCHL] as %SKSCHL_KEY&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..DZNSD_C161.qvd (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Condition_Type:&lt;BR /&gt;LOAD&lt;BR /&gt; [SID_SID] as %SKSCHL_KEY,&lt;BR /&gt; [Condition type_KSCHL]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..SKSCHL.QVD (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Feb 2010 16:35:24 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-02-05T16:35:24Z</dc:date>
    <item>
      <title>Restricted Keyfigures ('If select' statement across multiple tables)</title>
      <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232541#M84143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello QV Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to make an if statement across multiple tabels.&lt;/P&gt;&lt;P&gt;How can I solve this? This is a SAP BW cube, so it means Fact Table, Dimension Table and Attribute Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;// if([Condition type_KSCHL]='YA01', [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exchange rate_EXCHG_RATE]) as 'Restricted Keyfigure_YA01'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Keyfigures:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %ZNSD_C161_KEY,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX],&lt;BR /&gt; [Exchange rate_EXCHG_RATE]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Dimension:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; [Dimension Key_DIMID] as %ZNSD_C161_KEY,&lt;BR /&gt; [SID_SID_0KSCHL] as %SKSCHL_KEY&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..DZNSD_C161.qvd (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Condition_Type:&lt;BR /&gt;LOAD&lt;BR /&gt; [SID_SID] as %SKSCHL_KEY,&lt;BR /&gt; [Condition type_KSCHL]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..SKSCHL.QVD (qvd);&lt;/P&gt;&lt;P&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2010 16:35:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232541#M84143</guid>
      <dc:creator />
      <dc:date>2010-02-05T16:35:24Z</dc:date>
    </item>
    <item>
      <title>Restricted Keyfigures ('If select' statement across multiple tables)</title>
      <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232542#M84144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Somehow you need to join information. One option would be:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;tMap1:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; %ZNSD_C161_KEY as a1,&lt;BR /&gt; %SKSCHL_KEY as a2&lt;BR /&gt;RESIDENT Dimension;&lt;/P&gt;&lt;P&gt;Left join (tMap1)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; %SKSCHL_KEY as a2,&lt;BR /&gt; [Condition type_KSCHL], as a3&lt;BR /&gt;RESIDENT Condition_Type;&lt;/P&gt;&lt;P&gt;Map:&lt;BR /&gt;MAPPING LOAD a1 as key, a3 as value RESIDENT tMap1:&lt;/P&gt;&lt;P&gt;drop table tMap1:&lt;/P&gt;&lt;P&gt;Keyfigures:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %ZNSD_C161_KEY,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX],&lt;BR /&gt; [Exchange rate_EXCHG_RATE],&lt;BR /&gt; if(applymap('Map', %ZNSD_C161_KEY, null()) ='YA01', [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exchange rate_EXCHG_RATE]) as 'Restricted Keyfigure_YA01'&lt;BR /&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD (qvd);&lt;/P&gt;&lt;P&gt;Not sure how performant it woudl be though.&lt;/P&gt;&lt;P&gt;I would rather make arrangements in the extractor itself so that I get [Condition type_KSCHL] joined to Dimension QVD itself.&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Rakesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Feb 2010 18:23:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232542#M84144</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-05T18:23:24Z</dc:date>
    </item>
    <item>
      <title>Restricted Keyfigures ('If select' statement across multiple tables)</title>
      <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232543#M84145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;I had to make a few (small) changes to your script to let it work, like this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET v325='325';&lt;/P&gt;&lt;P&gt;tMap1:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; %ZNSD_C161_KEY as a1,&lt;BR /&gt; %SKSCHL_KEY as a2&lt;BR /&gt;RESIDENT Dimension;&lt;/P&gt;&lt;P&gt;Left join (tMap1)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; %SKSCHL_KEY as a2,&lt;BR /&gt; [Condition type_KSCHL] as a3&lt;BR /&gt;RESIDENT Condition_Type;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Map:&lt;BR /&gt;MAPPING LOAD&lt;BR /&gt;a1 as key,&lt;BR /&gt;a3 as value&lt;BR /&gt;RESIDENT tMap1;&lt;BR /&gt;drop table tMap1;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;Keyfigures:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %ZNSD_C161_KEY,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX],&lt;BR /&gt; [Exch.rate-acct._EXRATE_ACC],&lt;BR /&gt; [Exchange rate_EXCHG_RATE],&lt;BR /&gt; // if(applymap( 'Map', [Dimension Key_KEY_ZNSD_C161], null() ),'325', [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exch.rate-acct._EXRATE_ACC]) as 'Restricted Keyfigure_Y013',&lt;BR /&gt; if(applymap( 'Map', [Dimension Key_KEY_ZNSD_C161], null() ),$(v325), [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exch.rate-acct._EXRATE_ACC]) as 'Restricted Keyfigure_Y013'&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD&lt;BR /&gt;(qvd);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it still doesn't do, what I want it to do. I still have to make a selection (Y013 or 325) first before it gives the correct result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want is always this result, without selecting, because I have to make 40 different restricted Keyfigures, were the customer can select from, in his report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a solution, with set-analysis, but I want to present these 40 restricted keyfigures as fields he can select from in his querying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;P&gt;Sven&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 13:53:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232543#M84145</guid>
      <dc:creator />
      <dc:date>2010-02-08T13:53:47Z</dc:date>
    </item>
    <item>
      <title>Restricted Keyfigures ('If select' statement across multiple tables)</title>
      <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232544#M84146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sven,&lt;/P&gt;&lt;P&gt;In that case, you would be better off merginf all tables in one, and then creating a final keyfigure table having your "final" keyfigures. Something like below will give you an idea. I have typed the code in notepad just to show an idea, not sure if it will work 100% with copy and paste. Let me know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;Dimension:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_DIMID] as %ZNSD_C161_KEY,&lt;BR /&gt; [SID_SID_0KSCHL] as %SKSCHL_KEY&lt;BR /&gt;FROM&lt;BR /&gt;..DZNSD_C161.qvd (qvd);&lt;BR /&gt;Left join (Dimension)&lt;BR /&gt;LOAD&lt;BR /&gt; [SID_SID] as %SKSCHL_KEY,&lt;BR /&gt; [Condition type_KSCHL]&lt;BR /&gt;FROM&lt;BR /&gt;..SKSCHL.QVD (qvd);&lt;BR /&gt;drop field %SKSCHL_KEY;&lt;BR /&gt;tKeyfigures:&lt;BR /&gt;LOAD&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %ZNSD_C161_KEY,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX],&lt;BR /&gt; [Exchange rate_EXCHG_RATE]&lt;BR /&gt;&lt;BR /&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD (qvd);&lt;BR /&gt;Left join (tKeyfigures)&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; %ZNSD_C161_KEY,&lt;BR /&gt; [Condition type_KSCHL]&lt;BR /&gt;RESIDENT Dimension;&lt;BR /&gt;drop table Dimension;&lt;BR /&gt;KeyFigures:&lt;BR /&gt;LOAD DISTINCT&lt;BR /&gt; [Dimension Key_KEY_ZNSD_C161] as %DimKey&lt;BR /&gt;FROM&lt;BR /&gt;..FZNSD_C16.QVD (qvd);&lt;BR /&gt;Left join (KeyFigures)&lt;BR /&gt;LOAD %ZNSD_C161_KEY as %DimKey,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exchange rate_EXCHG_RATE] as [Restricted Keyfigure_YA01]&lt;BR /&gt;RESIDENT tKeyfigures&lt;BR /&gt;WHERE [Condition type_KSCHL] = 'YA01';&lt;BR /&gt;Left join (KeyFigures)&lt;BR /&gt;LOAD %ZNSD_C161_KEY as %DimKey,&lt;BR /&gt; [Cond Val (Exec rep)_/BIC/ZN_K_VEX]*[Exchange rate_EXCHG_RATE] as [Restricted Keyfigure_YA03]&lt;BR /&gt;RESIDENT tKeyfigures&lt;BR /&gt;WHERE [Condition type_KSCHL] = 'YA03';&lt;BR /&gt;drop table tKeyfigures;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Feb 2010 15:59:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232544#M84146</guid>
      <dc:creator>disqr_rm</dc:creator>
      <dc:date>2010-02-08T15:59:46Z</dc:date>
    </item>
    <item>
      <title>Restricted Keyfigures ('If select' statement across multiple tables)</title>
      <link>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232545#M84147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rakesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your solution as described works, but just for a limited qty of calculated / restricted KF's.&lt;/P&gt;&lt;P&gt;Above 20 KF's we suffered performance issues on the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I found another solution which works fine.&lt;/P&gt;&lt;P&gt;I put the complete KF calculation (SET ANALYSIS) in a SET statement as a variable.&lt;/P&gt;&lt;P&gt;The user just has to select the wanted variable and put -&amp;gt; =$(variable ) in the Chart.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your suggestion&lt;/P&gt;&lt;P&gt;KR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2010 09:32:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Restricted-Keyfigures-If-select-statement-across-multiple-tables/m-p/232545#M84147</guid>
      <dc:creator />
      <dc:date>2010-02-24T09:32:05Z</dc:date>
    </item>
  </channel>
</rss>

