<?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 Using conditions in the script to create groups in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303732#M1193317</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both solutions worked well so far, the alternative code has helped me get my head around some of the scripting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Jun 2011 15:53:40 GMT</pubDate>
    <dc:creator>mrchristopher</dc:creator>
    <dc:date>2011-06-20T15:53:40Z</dc:date>
    <item>
      <title>Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303727#M1193312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to create a new field within the script so that I can group data within Qlikview. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The condition is based on the 1st letter of the field 'Product Class' e.g. All product classes equal to 'A' = 'Group A' and everything else = 'Other'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;ODBC&lt;/SPAN&gt; &lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;CONNECT&lt;/STRONG&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; font-size: 9pt;"&gt;TO&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; SysproCompanyA;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;SQL&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; SELECT Area,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;CostValue,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Customer,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;CustomerClass,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;NetSalesValue,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;ProductClass,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;QtyInvoiced,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;Salesperson,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;StockCode,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;TrnMonth,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;TrnYear,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt;FROM SysproCompanyA.dbo.ArTrnDetail;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: blue; font-size: 9pt; font-family: 'Courier New';"&gt;SELECT&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; ProductClass, (Left(ProductClass,1)) AS Sector FROM SysproCompanyA.dbo.ArTrnDetail;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; color: black; font-size: 10pt;"&gt;I've tried various If statments but I can't get any to work. Can you help?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; color: black; font-size: 10pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif; color: black; font-size: 10pt;"&gt;BTW this is my 1st day of looking at any SQL scripting, so go easy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; font-size: 9pt;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 14:41:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303727#M1193312</guid>
      <dc:creator>mrchristopher</dc:creator>
      <dc:date>2011-06-20T14:41:24Z</dc:date>
    </item>
    <item>
      <title>Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303728#M1193313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Instead of creating group in script you can create groups in document.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Click on Settings-&amp;gt; Document Properties -&amp;gt; Groups &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Here you can create groups as per you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:02:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303728#M1193313</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-06-20T15:02:04Z</dc:date>
    </item>
    <item>
      <title>Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303729#M1193314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Excellent soloution, Thank You.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:12:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303729#M1193314</guid>
      <dc:creator>mrchristopher</dc:creator>
      <dc:date>2011-06-20T15:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303730#M1193315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Kaushik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That Groups tab is used to create drill down groups and cyclic groups based on existing fields (or even using expressions) but it doesn't seem to be the case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the following code instead&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE ___default_attr="plain" jivemacro="code"&gt;&lt;P&gt;ODBC CONNECT TO SysproCompanyA;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Table: // table label, not mandatory but very useful&lt;/P&gt;&lt;P&gt;LOAD Area, // the LOAD part is not mandatory either, but it's very recommended since it allows you to create new fields &lt;/P&gt;&lt;P&gt;Area,&lt;/P&gt;&lt;P&gt;CostValue,&lt;/P&gt;&lt;P&gt;Customer,&lt;/P&gt;&lt;P&gt;CustomerClass,&lt;/P&gt;&lt;P&gt;NetSalesValue,&lt;/P&gt;&lt;P&gt;ProductClass,&lt;/P&gt;&lt;P&gt;QtyInvoiced,&lt;/P&gt;&lt;P&gt;Salesperson,&lt;/P&gt;&lt;P&gt;StockCode,&lt;/P&gt;&lt;P&gt;TrnMonth,&lt;/P&gt;&lt;P&gt;TrnYear,&lt;/P&gt;&lt;P&gt;If(Left(ProductClass, 1) = 'A', 'Group A', 'Other') AS ProductGroup // this will create a new field based on the value existing in ProductClass&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;SQL SELECT Area,&lt;/P&gt;&lt;P&gt;CostValue,&lt;/P&gt;&lt;P&gt;Customer,&lt;/P&gt;&lt;P&gt;CustomerClass,&lt;/P&gt;&lt;P&gt;NetSalesValue,&lt;/P&gt;&lt;P&gt;ProductClass,&lt;/P&gt;&lt;P&gt;QtyInvoiced,&lt;/P&gt;&lt;P&gt;Salesperson,&lt;/P&gt;&lt;P&gt;StockCode,&lt;/P&gt;&lt;P&gt;TrnMonth,&lt;/P&gt;&lt;P&gt;TrnYear&lt;/P&gt;&lt;P&gt;FROM SysproCompanyA.dbo.ArTrnDetail;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.qlik.com/people/mabaeyens" style="font-size: 12px; outline-style: none; padding-top: 1px; padding-bottom: 1px; padding-left: 17px; color: #007fc0; zoom: 1; background-position: no-repeat no-repeat;"&gt;Miguel Angel Baeyens&lt;/A&gt;&lt;/P&gt;&lt;P&gt;BI Consultant&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.grupocomex.com/" style="font-size: 12px; outline-style: none; color: #007fc0;"&gt;Comex Grupo Ibérica&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:12:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303730#M1193315</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2011-06-20T15:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303731#M1193316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Miguel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; You are right sir, but &lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://community.qlik.com/people/mrchristopher" id="jive-585943947678771053713" style="font-size: 12px; color: #007fc0; font-weight: bold;"&gt;mrchristopher&lt;/A&gt; said that he is not good at sql. And he wanted to group the data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thus i have suggested him that way. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kaushik Solanki &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:21:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303731#M1193316</guid>
      <dc:creator>kaushiknsolanki</dc:creator>
      <dc:date>2011-06-20T15:21:43Z</dc:date>
    </item>
    <item>
      <title>Using conditions in the script to create groups</title>
      <link>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303732#M1193317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Both solutions worked well so far, the alternative code has helped me get my head around some of the scripting. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jun 2011 15:53:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-conditions-in-the-script-to-create-groups/m-p/303732#M1193317</guid>
      <dc:creator>mrchristopher</dc:creator>
      <dc:date>2011-06-20T15:53:40Z</dc:date>
    </item>
  </channel>
</rss>

