<?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 needed to create an expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316609#M584143</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;You have to write a code like below or just add city='NewYork' because it will connected with EMPLOYEE_ID i assume it if it is connected then the below code works better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT( if(([SPEND] &amp;gt; 5 and Match(MEAL_TYPE,'Lunch','Breakfast'))&lt;/P&gt;&lt;P&gt;or ([SPEND] &amp;gt; 10 and Match(MEAL_TYPE,'Dinner') and&amp;nbsp; CITY='NewYork' )&lt;/P&gt;&lt;P&gt;,[EMPLOYEE_ID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know about this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Oct 2011 04:43:04 GMT</pubDate>
    <dc:creator>its_anandrjs</dc:creator>
    <dc:date>2011-10-06T04:43:04Z</dc:date>
    <item>
      <title>Help needed to create an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316608#M584142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am creating an expression that can give count of all employees who had spent &amp;gt; 5 for lunch/Breakfast and &amp;gt; 10 for dinner . I would&amp;nbsp; like to include only employees who are in city='NewYork'. I have my formula as below which works, but I also need to put a condition that will make the below calculation only for New York employees&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT( if(([SPEND] &amp;gt; 5 and Match(MEAL_TYPE,'Lunch','Breakfast'))&lt;/P&gt;&lt;P&gt; or ([SPEND] &amp;gt; 10 and Match(MEAL_TYPE,'Dinner'))&lt;/P&gt;&lt;P&gt; ,[EMPLOYEE_ID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI. There are 2 tables A and B&lt;/P&gt;&lt;P&gt;A has below fields&lt;/P&gt;&lt;P&gt;MONTH,SPEND,MEALTYPE,EMPLOYEE_ID&lt;/P&gt;&lt;P&gt;B has below fields&lt;/P&gt;&lt;P&gt;EMPLOYEE_ID,CITY&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope i need to use set analysis which i am trying to learn.Please help me resolve the above issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 01:51:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316608#M584142</guid>
      <dc:creator />
      <dc:date>2011-10-06T01:51:07Z</dc:date>
    </item>
    <item>
      <title>Help needed to create an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316609#M584143</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;You have to write a code like below or just add city='NewYork' because it will connected with EMPLOYEE_ID i assume it if it is connected then the below code works better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT( if(([SPEND] &amp;gt; 5 and Match(MEAL_TYPE,'Lunch','Breakfast'))&lt;/P&gt;&lt;P&gt;or ([SPEND] &amp;gt; 10 and Match(MEAL_TYPE,'Dinner') and&amp;nbsp; CITY='NewYork' )&lt;/P&gt;&lt;P&gt;,[EMPLOYEE_ID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know about this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 04:43:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316609#M584143</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2011-10-06T04:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help needed to create an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316610#M584144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;﻿﻿﻿Hi for set analysis use this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿﻿﻿﻿﻿﻿﻿﻿&lt;/P&gt;﻿﻿count( {&amp;nbsp; &amp;lt;spend={"&amp;gt;5"},meal_type={'lunch','breakfast'},city={'new york'}&amp;gt;+ &amp;lt;spend={"&amp;gt;10"},meal_type={'dinner'},city={'new york'}﻿﻿﻿﻿﻿&amp;gt; } Employee id)&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 05:47:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316610#M584144</guid>
      <dc:creator>qliksus</dc:creator>
      <dc:date>2011-10-06T05:47:06Z</dc:date>
    </item>
    <item>
      <title>Help needed to create an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316611#M584145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anand,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 2 tables are connected but below formula does not work. I am not sure if you can use fields from 2 different tables in the same expression for aggregation function&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT( if(([SPEND] &amp;gt; 5 and Match(MEAL_TYPE,'Lunch','Breakfast'))&lt;/P&gt;&lt;P&gt;or ([SPEND] &amp;gt; 10 and Match(MEAL_TYPE,'Dinner') and&amp;nbsp; CITY='NewYork' )&lt;/P&gt;&lt;P&gt;,[EMPLOYEE_ID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above formula removes&amp;nbsp; employees who had spent on dinner and includes employess in other cities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 20:28:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316611#M584145</guid>
      <dc:creator />
      <dc:date>2011-10-06T20:28:17Z</dc:date>
    </item>
    <item>
      <title>Help needed to create an expression</title>
      <link>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316612#M584146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Qliksus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the below expression does not give me any result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿count( {&amp;nbsp; &amp;lt;spend={"&amp;gt;5"},meal_type={'lunch','breakfast'},city={'new york'}&amp;gt;+ &amp;lt;spend={"&amp;gt;10"},meal_type={'dinner'},city={'new york'}﻿﻿﻿﻿﻿&amp;gt; } Employee id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The below expression &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿﻿count( {&amp;nbsp; &amp;lt;spend={"&amp;gt;5"},meal_type={'lunch','breakfast'}&amp;gt;+ &amp;lt;spend={"&amp;gt;10"},meal_type={'dinner'},city={'new york'}﻿﻿﻿﻿﻿&amp;gt; } Employee id)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;behaves exactly like &lt;/P&gt;&lt;P&gt;=COUNT(DISTINCT( if(([SPEND] &amp;gt; 5 and Match(MEAL_TYPE,'Lunch','Breakfast'))&lt;/P&gt;&lt;P&gt;or ([SPEND] &amp;gt; 10 and Match(MEAL_TYPE,'Dinner') and&amp;nbsp; CITY='NewYork' )&lt;/P&gt;&lt;P&gt;,[EMPLOYEE_ID])))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where it removes&amp;nbsp; employees who had spent on dinner and includes employess in other cities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Naveen.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 21:00:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Help-needed-to-create-an-expression/m-p/316612#M584146</guid>
      <dc:creator />
      <dc:date>2011-10-06T21:00:26Z</dc:date>
    </item>
  </channel>
</rss>

