<?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 Re: Set Analysis Using 'Or' Condition and Distinct Count in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93319#M6220</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the total spend set analysis works.&amp;nbsp; I dont' think I will be able to share a sample.&amp;nbsp; It is possible there could be missing data for the PO Line.&amp;nbsp; If there are null values could that cause any issues?&amp;nbsp; The QlikSense version I am using is November 2017, do you think there could be possible bugs in the system?&amp;nbsp; I am giong to try to recreate the same App on Qlik Desktop to see if there could be any bugs with the eneterprise version. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Jul 2018 20:09:16 GMT</pubDate>
    <dc:creator>kristen_ludlow</dc:creator>
    <dc:date>2018-07-06T20:09:16Z</dc:date>
    <item>
      <title>Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93309#M6210</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am working to create a percentage of total PO Lines based on two different flags.&amp;nbsp; If at least one of the Flag is equal to 'Y', I want to count that line.&amp;nbsp; The count is also dependent on a date variable for the current month and year.&amp;nbsp; When I conduct the below set analysis, the formula does not work.&amp;nbsp; I have tested the variable and know that it works.&amp;nbsp; I have used the same formula for a sum of total spend instead of a count and the formula worked.&amp;nbsp; Can anyone offer some support as to where I am going wrong or offer a different solution? Thank you so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Field set in script:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Date([PO Date],'MMM-YYYY') as MonthYear,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Variable:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;vCurMonthYear&lt;/SPAN&gt;=DATE(max([PO Date]),'MMM-YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set Analysis:&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Cntrct Flg]={'Y'}, MonthYear={'$(=vCurMonthYear)'}&amp;gt;+&amp;lt;[Active]={'Y'}, MonthYear={'$(=vCurMonthYear)'}&amp;gt;}distinct[PO Line])/count({$&amp;lt;MonthYear={'$(=vCurMonthYear)'}&amp;gt;}distinct[PO Line])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Dec 2021 15:42:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93309#M6210</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2021-12-22T15:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93310#M6211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample so that we can check it out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 02:55:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93310#M6211</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-29T02:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93311#M6212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if the attached sample will work.&amp;nbsp; Thank you for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:48:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93311#M6212</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2018-06-29T14:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93312#M6213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This should work, the only thing which will be helpful to know would be the expected output based on the sample provided?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 14:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93312#M6213</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-29T14:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93313#M6214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you hoping to see 1438? May be try to change the variable to this&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;vCurMonthYear &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;STRONG&gt;= Date(&lt;SPAN style="color: #ff0000;"&gt;MonthStart(&lt;/SPAN&gt;Max([PO Date])&lt;SPAN style="color: #ff0000;"&gt;)&lt;/SPAN&gt;,'MMM-YYYY');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where MonthYear field is created in the script like this&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Date(MonthStart([PO Date]), 'MMM-YYYY') as MonthYear&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 15:05:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93313#M6214</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-29T15:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93314#M6215</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes, the PO Line count with the "Y" flag would be 1438.&amp;nbsp; Ultimately, I am hoping to obtain a percentage value of distinct PO Lines that have either a Y flag in the "Cntrct Flg" or "Active" Column out of the total distinct PO Lines.&amp;nbsp; I have attached a sample of the formula I would write in Excel to achieve this with a combination of a Pivot Table to show the percentage value I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will try to update the variable based on your suggestion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for all of your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 17:26:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93314#M6215</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2018-06-29T17:26:53Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93315#M6216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I updated the variable and the script with your suggestions.&amp;nbsp; As separate formulas the below both work for me but not combined together.&amp;nbsp; How I want to combine them to count the distinct&amp;nbsp; PO Lines that have a "Y" in either the "Cntrct Flg" Field or the "Active" Field divded into the distinct count of PO Lines?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Active]={'Y'}, MonthYear={'$(=vCurMonthYear)'}&amp;gt;} distinct [PO Line])/count({$&amp;lt;MonthYear={'$(=vCurMonthYear)'}&amp;gt;} distinct [PO Line])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;[Cntrct Flg]={'Y'}, MonthYear={'$(=vCurMonthYear)'}&amp;gt;} distinct [PO Line])/count({$&amp;lt;MonthYear={'$(=vCurMonthYear)'}&amp;gt;} distinct [PO Line])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jun 2018 18:28:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93315#M6216</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2018-06-29T18:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93316#M6217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But this hasn't worked?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count({$&amp;lt;[Active] = {'Y'}, MonthYear = {'$(=vCurMonthYear)'}&amp;gt;+&amp;lt;[Cntrct Flg] = {'Y'}, MonthYear = {'$(=vCurMonthYear)'}&amp;gt;} DISTINCT [PO Line])/Count({$&amp;lt;MonthYear = {'$(=vCurMonthYear)'}&amp;gt;} DISTINCT [PO Line])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Jun 2018 11:44:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93316#M6217</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-06-30T11:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93317#M6218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The above formula provides a value of 0.0%.&amp;nbsp; A similar formula using Sum and Total Spend provide me with a percentage value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Cntrct Flg]={'Y'},MonthYear={'$(=vCurMonthYear)'}&amp;gt;+&amp;lt;[Active]={'Y'},MonthYear='$(=vCurMonthYear)'}&amp;gt;}[Total Spend])/sum({$&amp;lt;MonthYear={'$(=vCurMonthYear)'}&amp;gt;}[Total Spend])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Script, I mapped in the field "Active" from the Contracts Table to the PO Table.&amp;nbsp; There are only about 90 Suppliers in the Contract Table so they do not all correspond to the Suppliers in the PO Table.&amp;nbsp; I was having issues with formulas so I mapped in the "Active" field to match up with the Supplier name. Do you think this could be a reason the percent value does not work with count?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of Tables&lt;/P&gt;&lt;P&gt;Contracts:&lt;/P&gt;&lt;P&gt;LOAD Owner&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Supplier ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Supplier Name], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Contract Category],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 10pt;"&gt;Discount Payment Terms], &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Active] as [PCF]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contracts_Map:&lt;/P&gt;&lt;P&gt;mapping LOAD &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Supplier Name], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Active]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PO:&lt;/P&gt;&lt;P&gt;LOAD Year, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quarter, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; month(Month) as Month, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Client Name], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PO Date], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; year([PO Date]) as Yearcreated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QuarterName([PO Date]) as Quartercreated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Month([PO Date]) as Monthcreated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Date(MonthStart([PO Date]), 'MMM-YYYY') as MonthYear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PO No.], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PO No.]&amp;amp;'_'&amp;amp;[PO Line] as [PO Line], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [PO Descr], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Supplier Name],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Quantity, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UOM], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(len([Cntrct Flg])=0,'N',[Cntrct Flg]) as [Cntrct Flg], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Total Spend], &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; applymap('Contracts_Map',[Supplier Name],'N') as [Active]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jul 2018 15:38:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93317#M6218</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2018-07-02T15:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93318#M6219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, the same set analysis with Total Spend works, but PO Line doesn't work? That is sort of very strange... is there any way you can share a sample to test this out?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jul 2018 23:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93318#M6219</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-07-04T23:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis Using 'Or' Condition and Distinct Count</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93319#M6220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, the total spend set analysis works.&amp;nbsp; I dont' think I will be able to share a sample.&amp;nbsp; It is possible there could be missing data for the PO Line.&amp;nbsp; If there are null values could that cause any issues?&amp;nbsp; The QlikSense version I am using is November 2017, do you think there could be possible bugs in the system?&amp;nbsp; I am giong to try to recreate the same App on Qlik Desktop to see if there could be any bugs with the eneterprise version. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Jul 2018 20:09:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-Using-Or-Condition-and-Distinct-Count/m-p/93319#M6220</guid>
      <dc:creator>kristen_ludlow</dc:creator>
      <dc:date>2018-07-06T20:09:16Z</dc:date>
    </item>
  </channel>
</rss>

