<?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 Formula in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Formula-in-script/m-p/1656374#M593780</link>
    <description>&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;I hope someone can help me here. What is wrong with my script highlighted in red?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[TEMP Sales Value Entries]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Item No_" as "Item No",&lt;BR /&gt;Year("Posting Date") as [Value Entry Year],&lt;BR /&gt;Month("Posting Date") as [Value Entry Month],&lt;BR /&gt;"Sales Amount (Actual)",&lt;BR /&gt;"Global Dimension 2 Code" as BU,&lt;BR /&gt;"Cost Amount (Actual)";&lt;BR /&gt;&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"Item No_",&lt;BR /&gt;"Posting Date",&lt;BR /&gt;"Sales Amount (Actual)",&lt;BR /&gt;"Global Dimension 2 Code",&lt;BR /&gt;"Cost Amount (Actual)",&lt;BR /&gt;"Document Type"&lt;BR /&gt;"Gen_ Prod_ Posting Group"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FROM $Value Entry"&lt;BR /&gt;Where "Document Type" in ('2','3')&lt;BR /&gt;and "Global Dimension 2 Code" not in ('QA','NPD')&lt;BR /&gt;and "Gen_ Prod_ Posting Group" in ('FG')&lt;BR /&gt;and "Posting Date" &amp;gt; = '01/01/2019';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join ([TEMP Sales Value Entries])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"No_" as "Item No",&lt;BR /&gt;Description as [Item Description],&lt;BR /&gt;"Routing No_" as "Routing No";&lt;BR /&gt;&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"No_",&lt;BR /&gt;Description,&lt;BR /&gt;"Routing No_"&lt;BR /&gt;FROM $Item";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Sales Value Entries]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Item No",&lt;BR /&gt;[Value Entry Year],&lt;BR /&gt;[Value Entry Month],&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;sum("Sales Amount (Actual)") + sum("Cost Amount (Actual)") / sum("Sales Amount (Actual)") as [Gross Profit],&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;BU,&lt;BR /&gt;[Item Description],&lt;BR /&gt;"Routing No"&lt;/P&gt;&lt;P&gt;Resident [TEMP Sales Value Entries];&lt;BR /&gt;DROP Table [TEMP Sales Value Entries];&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 01:43:36 GMT</pubDate>
    <dc:creator>ranibosch</dc:creator>
    <dc:date>2024-11-16T01:43:36Z</dc:date>
    <item>
      <title>Formula in script</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-script/m-p/1656374#M593780</link>
      <description>&lt;P&gt;Good day,&lt;/P&gt;&lt;P&gt;I hope someone can help me here. What is wrong with my script highlighted in red?&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[TEMP Sales Value Entries]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Item No_" as "Item No",&lt;BR /&gt;Year("Posting Date") as [Value Entry Year],&lt;BR /&gt;Month("Posting Date") as [Value Entry Month],&lt;BR /&gt;"Sales Amount (Actual)",&lt;BR /&gt;"Global Dimension 2 Code" as BU,&lt;BR /&gt;"Cost Amount (Actual)";&lt;BR /&gt;&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"Item No_",&lt;BR /&gt;"Posting Date",&lt;BR /&gt;"Sales Amount (Actual)",&lt;BR /&gt;"Global Dimension 2 Code",&lt;BR /&gt;"Cost Amount (Actual)",&lt;BR /&gt;"Document Type"&lt;BR /&gt;"Gen_ Prod_ Posting Group"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;FROM $Value Entry"&lt;BR /&gt;Where "Document Type" in ('2','3')&lt;BR /&gt;and "Global Dimension 2 Code" not in ('QA','NPD')&lt;BR /&gt;and "Gen_ Prod_ Posting Group" in ('FG')&lt;BR /&gt;and "Posting Date" &amp;gt; = '01/01/2019';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Left Join ([TEMP Sales Value Entries])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"No_" as "Item No",&lt;BR /&gt;Description as [Item Description],&lt;BR /&gt;"Routing No_" as "Routing No";&lt;BR /&gt;&lt;BR /&gt;SQL SELECT&lt;BR /&gt;"No_",&lt;BR /&gt;Description,&lt;BR /&gt;"Routing No_"&lt;BR /&gt;FROM $Item";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Sales Value Entries]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Item No",&lt;BR /&gt;[Value Entry Year],&lt;BR /&gt;[Value Entry Month],&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;sum("Sales Amount (Actual)") + sum("Cost Amount (Actual)") / sum("Sales Amount (Actual)") as [Gross Profit],&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;BU,&lt;BR /&gt;[Item Description],&lt;BR /&gt;"Routing No"&lt;/P&gt;&lt;P&gt;Resident [TEMP Sales Value Entries];&lt;BR /&gt;DROP Table [TEMP Sales Value Entries];&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 01:43:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-script/m-p/1656374#M593780</guid>
      <dc:creator>ranibosch</dc:creator>
      <dc:date>2024-11-16T01:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: Formula in script</title>
      <link>https://community.qlik.com/t5/QlikView/Formula-in-script/m-p/1656385#M593781</link>
      <description>&lt;P&gt;Since you need aggregate function like Sum,Count, Max, Min, Avg etc. You must define the "Group By" clause to group the element to the aggregate for non aggregate fields like&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;[Sales Value Entries]:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt;"Item No",&lt;BR /&gt;[Value Entry Year],&lt;BR /&gt;[Value Entry Month],&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;sum("Sales Amount (Actual)") + sum("Cost Amount (Actual)") / sum("Sales Amount (Actual)") as [Gross Profit],&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;BU,&lt;BR /&gt;[Item Description],&lt;BR /&gt;"Routing No"&lt;/P&gt;&lt;P&gt;Resident [TEMP Sales Value Entries] &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;Group By "Item No",&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;[Value Entry Year],&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;[Value Entry Month], &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;BU,&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;[Item Description],&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;"Routing No"&lt;/STRONG&gt;&lt;/FONT&gt;;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2019 08:10:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Formula-in-script/m-p/1656385#M593781</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2019-12-11T08:10:55Z</dc:date>
    </item>
  </channel>
</rss>

