<?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 Chart Help in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190356#M52901</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;again thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not aggregating everything, I was using the load command the software made from the excel sheet.&lt;/P&gt;&lt;P&gt;I have modified my script to basically just load the 1 thing I want to graph. It looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[SAP Account #]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[grp-SAP Orders1.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels);&lt;/P&gt;&lt;P&gt;if (count ([SAP Account#])&amp;lt;=1,1,0) as Customer_Flag RESIDENT data GROUP BY [SAP Account #];&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;That is all I have in the script (except for the set command for date time etc..) and I still get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 17 Nov 2010 20:15:59 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-11-17T20:15:59Z</dc:date>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190348#M52893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need some help with a chart. I have been able to create a list box with the following expression&lt;/P&gt;&lt;P&gt;if (count ([SAP Account #]) &amp;lt;= 1 , newcustomer, currentcustomer)&lt;/P&gt;&lt;P&gt;This tells me if the sap account number exists multiple times in the data and returns new or current customer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I want to do now is to chart the % of new vs. current&lt;/P&gt;&lt;P&gt;to get the total customers (or division portion) i am using count(distinct [sap account #])&lt;/P&gt;&lt;P&gt;what I can't figure out how to do is to calculate the total number of current or new (rather than just displaying the text).&lt;/P&gt;&lt;P&gt;expression 1 would be something like this in more of a practical programming sense (minus proper syntax)&lt;/P&gt;&lt;P&gt;-------------------&lt;/P&gt;&lt;P&gt;loop through account numbers&lt;/P&gt;&lt;P&gt;if (count ([SAP Account#]) &amp;lt;=1, newcustomer + 1, currentcustomer +1)&lt;/P&gt;&lt;P&gt;expression 1: newcustomers/total customers * 100&lt;/P&gt;&lt;P&gt;express 2: current customers/total customers * 100&lt;/P&gt;&lt;P&gt;-----------&lt;/P&gt;&lt;P&gt;I am really stuck on what the expression would be and any help would be much appreciated.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 20:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190348#M52893</guid>
      <dc:creator />
      <dc:date>2010-11-16T20:34:33Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190349#M52894</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For something like this, it's better to create a flag in your script to identify new customers. Then you can use simple set analysis to chart the expressions:&lt;/P&gt;&lt;P&gt;Expression #1: count(distinct {&amp;lt;NewCustomerFlag={1}&amp;gt;} [SAP Account #])/count(distinct [SAP Account #])&lt;BR /&gt;Expression #2: count(distinct {&amp;lt;NewCustomerFlag={0}&amp;gt;} [SAP Account #])/count(distinct [SAP Account #])&lt;/P&gt;&lt;P&gt;where NewCustomerFlag is the flag you create in your script. It would be even better if you can create a flag for each distinct account # so you can just sum the flag (this will work much faster than counting distinct).&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 21:22:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190349#M52894</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-11-16T21:22:52Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190350#M52895</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (count ([SAP Account #]) &amp;lt;= 1 ,1, 0) as NewCustomerFlag&lt;/P&gt;&lt;P&gt;then the newcustomerflag = 1 would be the true (&amp;lt; or = 1)&lt;/P&gt;&lt;P&gt;and newcustomerflag = 0 would be the false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the expression would be able to count the number of each?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 21:44:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190350#M52895</guid>
      <dc:creator />
      <dc:date>2010-11-16T21:44:20Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190351#M52896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yep. Keep in mind though that the expression would be counting distinct account numbers, not the flags themselves. Set analysis works by simulating a selection. So you can think of it intuitively as first selecting NewCustomerFlag of 1 from an imaginary listbox and then counting the account #s associated with that value of the NewCustomerFlag.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 21:53:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190351#M52896</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-11-16T21:53:21Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190352#M52897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;my apologies for being a pain but I am new to the scripting in QV&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting this error when running the script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggregation expressions not allowed in GROUP BY clause&lt;/P&gt;&lt;P&gt;if (count ([SAP Account #]) &amp;lt;= 1 ,1, 0) as Customer_Flag&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Nov 2010 22:21:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190352#M52897</guid>
      <dc:creator />
      <dc:date>2010-11-16T22:21:53Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190353#M52898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Don't mean to question you, but are you sure that's the error you're getting verbatim? Because GROUP BY is the only place where you &lt;EM&gt;can&lt;/EM&gt; aggregate. So your table load should look like this:&lt;/P&gt;&lt;P&gt;LOAD&lt;BR /&gt; [SAP Account #],&lt;BR /&gt; if(count(recordID)&amp;lt;=1,1,0) as NewCustFlag&lt;BR /&gt;RESIDENT data&lt;BR /&gt;GROUP BY [SAP Account #];&lt;/P&gt;&lt;P&gt;Note that it's better to count something other than what you're grouping by.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 00:42:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190353#M52898</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-11-17T00:42:15Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190354#M52899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't mind you questioning, because I am new to this so who knows what i am doing right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't have the Resident data or the Group by in my code.&lt;/P&gt;&lt;P&gt;I have tried the following syntax:&lt;/P&gt;&lt;P&gt;if (count ([SAP Account#])&amp;lt;=1,1,0) as Customer_Flag RESIDENT data GROUP BY [SAP Account #];&lt;/P&gt;&lt;P&gt;I have it placed after the LOAD (and all the items I am loading) from an excel sheet i am using for testing.&lt;/P&gt;&lt;P&gt;When I reload the script I get this message:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Aggregation expressions not allowed in GROUP BY clause&lt;/P&gt;&lt;P&gt;if (count ([SAP Account#])&amp;lt;=1,1,0) as Customer_Flag RESIDENT data GROUP BY [SAP Account #]&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 14:40:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190354#M52899</guid>
      <dc:creator />
      <dc:date>2010-11-17T14:40:55Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190355#M52900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect that's because you're not including the field you're aggregating by. So if your GROUP BY is over [SAP Account #] then you need to include [SAP Account #] in your load statement (without aggregation). The other fields in that load, however, must &lt;EM&gt;all&lt;/EM&gt; be aggregated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 20:03:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190355#M52900</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-11-17T20:03:43Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190356#M52901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;again thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was not aggregating everything, I was using the load command the software made from the excel sheet.&lt;/P&gt;&lt;P&gt;I have modified my script to basically just load the 1 thing I want to graph. It looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;[SAP Account #]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[grp-SAP Orders1.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels);&lt;/P&gt;&lt;P&gt;if (count ([SAP Account#])&amp;lt;=1,1,0) as Customer_Flag RESIDENT data GROUP BY [SAP Account #];&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;That is all I have in the script (except for the set command for date time etc..) and I still get the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Nov 2010 20:15:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190356#M52901</guid>
      <dc:creator />
      <dc:date>2010-11-17T20:15:59Z</dc:date>
    </item>
    <item>
      <title>Chart Help</title>
      <link>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190357#M52902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change it to this and it should work:&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;data:&lt;BR /&gt;LOAD&lt;BR /&gt; [SAP Account #]&lt;BR /&gt;FROM&lt;BR /&gt;[grp-SAP Orders1.xlsx] (ooxml, embedded labels);&lt;BR /&gt;LOAD&lt;BR /&gt; [SAP Account #],&lt;BR /&gt; if (count ([SAP Account#])&amp;lt;=1,1,0) as Customer_Flag&lt;BR /&gt;RESIDENT data&lt;BR /&gt;GROUP BY [SAP Account #];&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Meaning, this will run without errors. However, I would like to point out that it's better to be counting something other than what you're aggregating by.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Nov 2010 04:56:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Chart-Help/m-p/190357#M52902</guid>
      <dc:creator>vgutkovsky</dc:creator>
      <dc:date>2010-11-18T04:56:53Z</dc:date>
    </item>
  </channel>
</rss>

