<?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 Help with an expression... in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277042#M103304</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i would like to combine the following 2 expressions but am unsure on how to do it..&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Round(If([Deal Description] = '12721 - LUNCH TIME DEAL £3' or [Deal Description] = '200030 - LUNCH TIME DEAL £3' ,Sum(InDealQuantity)/3, Sum(InDealQuantity)/2))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;{$&amp;lt;[Supplier] = &amp;gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I basically want to add to the 1st expression the command to ignore any selection made from the 'Supplier' field.&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Jun 2011 14:41:49 GMT</pubDate>
    <dc:creator>hopkinsc</dc:creator>
    <dc:date>2011-06-09T14:41:49Z</dc:date>
    <item>
      <title>Help with an expression...</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277042#M103304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, i would like to combine the following 2 expressions but am unsure on how to do it..&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;Round(If([Deal Description] = '12721 - LUNCH TIME DEAL £3' or [Deal Description] = '200030 - LUNCH TIME DEAL £3' ,Sum(InDealQuantity)/3, Sum(InDealQuantity)/2))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;{$&amp;lt;[Supplier] = &amp;gt;}&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I basically want to add to the 1st expression the command to ignore any selection made from the 'Supplier' field.&lt;/P&gt;&lt;P&gt;Can anyone help please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 14:41:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277042#M103304</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-06-09T14:41:49Z</dc:date>
    </item>
    <item>
      <title>Help with an expression...</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277043#M103305</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;firstly you are better of doing a sum(if (...)) than an if(sum(..)) . Butthat depends on your data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the sum(if()) will test each record for your condition and act accordingly, whereas the if(sum()) will test the condition once an then sum. given that you are testing [deal description] I'd say it is the sum(if()) you shoudl be using.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this makes adding your set analysis easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Supplier] = &amp;gt;} &lt;/P&gt;&lt;P&gt;if([Deal Description] = '12721 - LUNCH TIME DEAL £3' or [Deal Description] = '200030 - LUNCH TIME DEAL £3' ,InDealQuantity/3, InDealQuantity/3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should start by ignoring any supplier selections made elsewhere and then sum the IDealQuantity, dividing each line by 3 if part of the £3 deal and by 2 if not part of the deal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;does this make sense?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jun 2011 16:28:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277043#M103305</guid>
      <dc:creator>pat_agen</dc:creator>
      <dc:date>2011-06-09T16:28:44Z</dc:date>
    </item>
    <item>
      <title>Help with an expression...</title>
      <link>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277044#M103306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi, thanks for your reply...&lt;/P&gt;&lt;P&gt;It didn't work for me using Sum(If, it gave me wrong figures, so i used the following which seems to work as i wanted...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Round(If ([Deal Description] = '12721 - LUNCH TIME DEAL £3' or [Deal Description] = '200030 - LUNCH TIME DEAL £3' ,Sum({$&amp;lt;[Supplier] = &amp;gt;}InDealQuantity)/3, Sum({$&amp;lt;[Supplier] = &amp;gt;}InDealQuantity)/2))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jun 2011 07:52:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-with-an-expression/m-p/277044#M103306</guid>
      <dc:creator>hopkinsc</dc:creator>
      <dc:date>2011-06-10T07:52:56Z</dc:date>
    </item>
  </channel>
</rss>

