<?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: Adding 1 Measure Based Off 2 Values in a Single Dimension (add a row of data) in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708330#M54346</link>
    <description>&lt;P&gt;Data:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;Company,StatementLine,TransactionAmount&lt;BR /&gt;A,'Sales',150&lt;BR /&gt;A,'Cost of Sales',100&lt;BR /&gt;];&lt;BR /&gt;Concatenate&lt;BR /&gt;load Company,&lt;BR /&gt;'Gross Margin' as StatementLine,&lt;BR /&gt;Sum(TransactionAmount) as TransactionAmount&lt;BR /&gt;Resident Data where Match(StatementLine,'Sales','Cost of Sales') &amp;gt; 0&lt;BR /&gt;Group by Company;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 19:22:11 GMT</pubDate>
    <dc:creator>jwjackso</dc:creator>
    <dc:date>2020-06-04T19:22:11Z</dc:date>
    <item>
      <title>Adding 1 Measure Based Off 2 Values in a Single Dimension (add a row of data)</title>
      <link>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708317#M54345</link>
      <description>&lt;P&gt;Hello friends!&lt;/P&gt;&lt;P&gt;I am working with some financial data. Here is what it looks like:&lt;/P&gt;&lt;TABLE width="300"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="75.5556px"&gt;Company&lt;/TD&gt;&lt;TD width="97.7778px"&gt;Statement Line&lt;/TD&gt;&lt;TD width="125.556px"&gt;Transaction Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="75.5556px"&gt;A&lt;/TD&gt;&lt;TD width="97.7778px"&gt;Sales&lt;/TD&gt;&lt;TD width="125.556px"&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="75.5556px"&gt;A&lt;/TD&gt;&lt;TD width="97.7778px"&gt;Cost of Sales&lt;/TD&gt;&lt;TD width="125.556px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate gross margin and have it appear in the same column as the statement lines I currently have:&lt;/P&gt;&lt;TABLE width="300"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="65"&gt;Company&lt;/TD&gt;&lt;TD width="102"&gt;Statement Line&lt;/TD&gt;&lt;TD width="133"&gt;Transaction Amount&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Sales&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Cost of Sales&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;Gross Margin&lt;/TD&gt;&lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway to do this in the data load editor? I need to have the calculated Statement Lines and the raw data statement lines appear in the same columns.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel like this can't be too difficult, maybe I'm just having an off day. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:31:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708317#M54345</guid>
      <dc:creator>gagewhite</dc:creator>
      <dc:date>2024-11-16T18:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 1 Measure Based Off 2 Values in a Single Dimension (add a row of data)</title>
      <link>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708330#M54346</link>
      <description>&lt;P&gt;Data:&lt;BR /&gt;LOAD * Inline [&lt;BR /&gt;Company,StatementLine,TransactionAmount&lt;BR /&gt;A,'Sales',150&lt;BR /&gt;A,'Cost of Sales',100&lt;BR /&gt;];&lt;BR /&gt;Concatenate&lt;BR /&gt;load Company,&lt;BR /&gt;'Gross Margin' as StatementLine,&lt;BR /&gt;Sum(TransactionAmount) as TransactionAmount&lt;BR /&gt;Resident Data where Match(StatementLine,'Sales','Cost of Sales') &amp;gt; 0&lt;BR /&gt;Group by Company;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 19:22:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708330#M54346</guid>
      <dc:creator>jwjackso</dc:creator>
      <dc:date>2020-06-04T19:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 1 Measure Based Off 2 Values in a Single Dimension (add a row of data)</title>
      <link>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708343#M54348</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/81491"&gt;@gagewhite&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a really long script, I know, but I I wanted to test a different logic.. &lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;Info:

LOAD * Inline [
Company,Statement Line,Transaction Amount
A,Sales,150
A,Cost of Sales,100
];

DATA:
generic load Company,[Statement Line],[Transaction Amount] Resident Info;


CombinedGenericTable:

Load distinct Company Resident Info;

drop Table Info;

FOR i = NoOfTables()-1 to 0 STEP -1

  LET vTable=TableName($(i));
  //trace $(i) - '$(vTable)';
  IF WildMatch('$(vTable)', 'DATA.*') THEN 

  LEFT JOIN ([CombinedGenericTable]) LOAD distinct * RESIDENT [$(vTable)];

  DROP TABLE [$(vTable)];

  ENDIF 

NEXT i


outputtmp:
noconcatenate
load *,(Sales-[Cost of Sales]) as [Gross Margin] Resident CombinedGenericTable;

drop table CombinedGenericTable;


output:

CrossTable([Statement Line], [Transaction Amount])
load * Resident outputtmp;
;
drop table outputtmp;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 825px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/34978iB31F12C07CF80478/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;attached qvf file&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 20:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1708343#M54348</guid>
      <dc:creator>Taoufiq_Zarra</dc:creator>
      <dc:date>2020-06-04T20:10:55Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 1 Measure Based Off 2 Values in a Single Dimension (add a row of data)</title>
      <link>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1709752#M54490</link>
      <description>&lt;P&gt;Woah! You just opened my eyes to the logic you can write in the load editor. I was a software developer before I became a data analyst, so this is music to my ears! Lengthy? Yes. Very informative? Absolutely!&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Gage&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jun 2020 13:21:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Adding-1-Measure-Based-Off-2-Values-in-a-Single-Dimension-add-a/m-p/1709752#M54490</guid>
      <dc:creator>gagewhite</dc:creator>
      <dc:date>2020-06-10T13:21:00Z</dc:date>
    </item>
  </channel>
</rss>

