<?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 How to create a field from filelds of 2 different tables in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186077#M50330</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no problem in charts,but in brings more calculations to the application,&lt;/P&gt;&lt;P&gt;so I want to find the way to creaty new field margin in the script..&lt;/P&gt;&lt;P&gt;please make qvw openable in PersonalEdition..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jun 2010 18:51:38 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-06-11T18:51:38Z</dc:date>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186075#M50328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem is that AccountingPrice (accounting price for 1 unit) is stored in one table (Products) and SalesPrice in another (Sales)&lt;/P&gt;&lt;P&gt;I calculate Margins in tables and graphs as&lt;/P&gt;&lt;P&gt;&lt;B&gt;Maring=sum(SalesPrice-AccountingPrice*Amount)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;But is slows down application, so the best way as I see it to calculate Margin as a field in one of the tables, of create another table and&lt;/P&gt;&lt;P&gt;joing it to one of them.. resident ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" class="jive_text_macro jive_macro_code" jivemacro="code"&gt;&lt;BR /&gt;Sales:&lt;BR /&gt;LOAD iddoc as idjournal,&lt;BR /&gt;sp283 as IdProduct,&lt;BR /&gt;sp285 as Pricefor1,&lt;BR /&gt;sp284 as Amount,&lt;BR /&gt;//sp285*sp284 as PricelistPrice (why it doesn't work??)&lt;BR /&gt; sp286 as SalesPrice,&lt;BR /&gt; sp287 as tax,&lt;BR /&gt; (sp286+sp287) as Sales;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `DT294`&lt;BR /&gt;where sp285&amp;gt;0;&lt;BR /&gt;&lt;BR /&gt;Products:&lt;BR /&gt;LOAD id as IdProduct,&lt;BR /&gt; descr as Product,&lt;BR /&gt; sp141 as AccountigPrice ;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `sc156` where isfolder=2;&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;and why doesn't work?:&lt;/P&gt;&lt;P&gt;&lt;B&gt;Let&lt;/B&gt; Maring=sum(SalesPrice-AccountingPrice*Amount)&lt;/P&gt;&lt;P&gt;So how to create a field from fields of 2 different tables into one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 16:18:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186075#M50328</guid>
      <dc:creator />
      <dc:date>2010-06-11T16:18:09Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186076#M50329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You should be able to do it in the chart itself, If not you can load in the script also,&lt;/P&gt;&lt;P&gt;I just put together small QVW for you, Please look in to it.&lt;/P&gt;&lt;P&gt;I Hope that help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:39:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186076#M50329</guid>
      <dc:creator />
      <dc:date>2010-06-11T18:39:21Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186077#M50330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There is no problem in charts,but in brings more calculations to the application,&lt;/P&gt;&lt;P&gt;so I want to find the way to creaty new field margin in the script..&lt;/P&gt;&lt;P&gt;please make qvw openable in PersonalEdition..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:51:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186077#M50330</guid>
      <dc:creator />
      <dc:date>2010-06-11T18:51:38Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186078#M50331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of this:&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;Alexadner Gonchar wrote:Sales:&lt;BR /&gt;LOAD iddoc as idjournal,&lt;BR /&gt;sp283 as IdProduct,&lt;BR /&gt;sp285 as Pricefor1,&lt;BR /&gt;sp284 as Amount,&lt;BR /&gt;//sp285*sp284 as PricelistPrice (why it doesn't work??)&lt;BR /&gt; sp286 as SalesPrice,&lt;BR /&gt; sp287 as tax,&lt;BR /&gt; (sp286+sp287) as Sales;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `DT294`&lt;BR /&gt;where sp285&amp;gt;0;&lt;BR /&gt;&lt;BR /&gt;Products:&lt;BR /&gt;LOAD id as IdProduct,&lt;BR /&gt; descr as Product,&lt;BR /&gt; sp141 as AccountigPrice ;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `sc156` where isfolder=2;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;Do this:&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;Sales:&lt;BR /&gt;LOAD iddoc as idjournal,&lt;BR /&gt;sp283 as IdProduct,&lt;BR /&gt;sp285 as Pricefor1,&lt;BR /&gt;sp284 as Amount,&lt;BR /&gt;//sp285*sp284 as PricelistPrice (why it doesn't work??)&lt;BR /&gt; sp286 as SalesPrice,&lt;BR /&gt; sp287 as tax,&lt;BR /&gt; (sp286+sp287) as Sales;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `DT294`&lt;BR /&gt;where sp285&amp;gt;0;&lt;BR /&gt;&lt;BR /&gt;LEFT JOIN (Sales)&lt;BR /&gt;LOAD id as IdProduct,&lt;BR /&gt; descr as Product,&lt;BR /&gt; sp141 as AccountigPrice ;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM `sc156` where isfolder=2;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:52:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186078#M50331</guid>
      <dc:creator />
      <dc:date>2010-06-11T18:52:04Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186079#M50332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here it the test script&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;/*******This table is just for data*******/&lt;BR /&gt;salesData:&lt;BR /&gt;Load * INLINE&lt;BR /&gt;[sp283,sp285, sp284, sp286&lt;BR /&gt; PR1 ,1,4,20&lt;BR /&gt; PR2 ,3,5,25&lt;BR /&gt; ];&lt;BR /&gt;&lt;BR /&gt; Sales:&lt;BR /&gt;LOAD&lt;BR /&gt; sp283 as IdProduct,&lt;BR /&gt; sp285 as Pricefor1,&lt;BR /&gt; sp284 as Amount,&lt;BR /&gt; sp285*sp284 as PricelistPrice ,&lt;BR /&gt; sp286 as SalesPrice&lt;BR /&gt;RESIDENT salesData;&lt;BR /&gt;/********this table is for data only *******/&lt;BR /&gt;ProductsData:&lt;BR /&gt;Load * INLINE&lt;BR /&gt; [id , descr, sp141&lt;BR /&gt; PR1,Product 1, 15&lt;BR /&gt; PR2, product 2, 10&lt;BR /&gt; ];&lt;BR /&gt;Product:&lt;BR /&gt;LOAD id as IdProduct,&lt;BR /&gt; descr as Product,&lt;BR /&gt; sp141 as AccountigPrice&lt;BR /&gt;RESIDENT ProductsData;&lt;BR /&gt;Left Join(Sales)&lt;BR /&gt;LOAD&lt;BR /&gt; IdProduct,&lt;BR /&gt; AccountigPrice&lt;BR /&gt;RESIDENT Product;&lt;BR /&gt;SalesAggr:&lt;BR /&gt;Load&lt;BR /&gt; IdProduct,&lt;BR /&gt; sum((SalesPrice-AccountigPrice)*Amount) as Margin&lt;BR /&gt;RESIDENT Sales&lt;BR /&gt;GROUP BY IdProduct;&lt;BR /&gt;&lt;BR /&gt; &lt;I&gt;&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;&lt;/I&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;B&gt;&lt;/B&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:58:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186079#M50332</guid>
      <dc:creator />
      <dc:date>2010-06-11T18:58:58Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186080#M50333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here it the test script&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;/*******This table is just for data*******/&lt;BR /&gt;salesData:&lt;BR /&gt;Load * INLINE&lt;BR /&gt;[sp283,sp285, sp284, sp286&lt;BR /&gt; PR1 ,1,4,20&lt;BR /&gt; PR2 ,3,5,25&lt;BR /&gt; ];&lt;BR /&gt;&lt;BR /&gt; Sales:&lt;BR /&gt;LOAD&lt;BR /&gt; sp283 as IdProduct,&lt;BR /&gt; sp285 as Pricefor1,&lt;BR /&gt; sp284 as Amount,&lt;BR /&gt; sp285*sp284 as PricelistPrice ,&lt;BR /&gt; sp286 as SalesPrice&lt;BR /&gt;RESIDENT salesData;&lt;BR /&gt;/********this table is for data only *******/&lt;BR /&gt;ProductsData:&lt;BR /&gt;Load * INLINE&lt;BR /&gt; [id , descr, sp141&lt;BR /&gt; PR1,Product 1, 15&lt;BR /&gt; PR2, product 2, 10&lt;BR /&gt; ];&lt;BR /&gt;Product:&lt;BR /&gt;LOAD id as IdProduct,&lt;BR /&gt; descr as Product,&lt;BR /&gt; sp141 as AccountigPrice&lt;BR /&gt;RESIDENT ProductsData;&lt;BR /&gt;Left Join(Sales)&lt;BR /&gt;LOAD&lt;BR /&gt; IdProduct,&lt;BR /&gt; AccountigPrice&lt;BR /&gt;RESIDENT Product;&lt;BR /&gt;SalesAggr:&lt;BR /&gt;Load&lt;BR /&gt; IdProduct,&lt;BR /&gt; sum((SalesPrice-AccountigPrice)*Amount) as Margin&lt;BR /&gt;RESIDENT Sales&lt;BR /&gt;GROUP BY IdProduct;&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 18:59:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186080#M50333</guid>
      <dc:creator />
      <dc:date>2010-06-11T18:59:04Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186081#M50334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Devang,&lt;/P&gt;&lt;P&gt;Try to use "[ code ]" and "[ / code ]" without spaces tags for code. And use Preview before submit a post&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 19:03:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186081#M50334</guid>
      <dc:creator />
      <dc:date>2010-06-11T19:03:51Z</dc:date>
    </item>
    <item>
      <title>How to create a field from filelds of 2 different tables</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186082#M50335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;I did and the preview was correct, Some how it got misaaligned in the post, I corrected it now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jun 2010 19:12:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-create-a-field-from-filelds-of-2-different-tables/m-p/186082#M50335</guid>
      <dc:creator />
      <dc:date>2010-06-11T19:12:13Z</dc:date>
    </item>
  </channel>
</rss>

