<?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: How to compare two different field in set expression? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63101#M779676</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;be careful f the format of date fields&lt;/P&gt;&lt;P&gt;try to put the formulas in text boxes to verify that the fields have correct format&lt;/P&gt;&lt;P&gt;i wouls suppose that Process Date is not in M/D/YYYY format &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 05 Apr 2018 12:49:24 GMT</pubDate>
    <dc:creator>olivierrobin</dc:creator>
    <dc:date>2018-04-05T12:49:24Z</dc:date>
    <item>
      <title>How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63099#M779674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Experts,&lt;/P&gt;&lt;P&gt;I have a table like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="374"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD height="20" width="86"&gt;Process Date&lt;/TD&gt;&lt;TD width="160"&gt;CAMPAIGN_START_DATE&lt;/TD&gt;&lt;TD width="64"&gt;Sales&lt;/TD&gt;&lt;TD width="64"&gt;Agent ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/1/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;2/1/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;500&lt;/TD&gt;&lt;TD align="right"&gt;111&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/2/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;5/1/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;600&lt;/TD&gt;&lt;TD align="right"&gt;222&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/3/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;5/13/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;700&lt;/TD&gt;&lt;TD align="right"&gt;333&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/4/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;5/21/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;800&lt;/TD&gt;&lt;TD align="right"&gt;444&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/5/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;5/29/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;900&lt;/TD&gt;&lt;TD align="right"&gt;555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/6/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;6/2/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1000&lt;/TD&gt;&lt;TD align="right"&gt;666&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/7/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;6/3/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1100&lt;/TD&gt;&lt;TD align="right"&gt;777&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/8/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;6/9/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1200&lt;/TD&gt;&lt;TD align="right"&gt;888&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl65" height="20"&gt;1/9/2018&lt;/TD&gt;&lt;TD align="right" class="xl66"&gt;6/18/2015 12:00:00 AM&lt;/TD&gt;&lt;TD align="right"&gt;1300&lt;/TD&gt;&lt;TD align="right"&gt;999&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;Below code not working for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg({$&amp;lt;[Process Date]=P({"&amp;gt;=$(=addmonths(Max(CAMPAIGN_START_DATE),-6)) &amp;lt;=$(=date(Max(CAMPAIGN_START_DATE),'MM/DD/YYYY'))"})&amp;gt;}[Sales Amt])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think two different field cant be compare in set exp.So please suggest any alternative idea inclding IF condition.&lt;/P&gt;&lt;P&gt;I dont have access to the script part so cant create any additional flag&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63099#M779674</guid>
      <dc:creator>anindya_manna</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63100#M779675</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;Can you explain more on your actual requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 12:48:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63100#M779675</guid>
      <dc:creator>HarishG</dc:creator>
      <dc:date>2018-04-05T12:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63101#M779676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;be careful f the format of date fields&lt;/P&gt;&lt;P&gt;try to put the formulas in text boxes to verify that the fields have correct format&lt;/P&gt;&lt;P&gt;i wouls suppose that Process Date is not in M/D/YYYY format &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 12:49:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63101#M779676</guid>
      <dc:creator>olivierrobin</dc:creator>
      <dc:date>2018-04-05T12:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63102#M779677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What exactly are you trying to get and what object?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 12:55:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63102#M779677</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2018-04-05T12:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63103#M779678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to get &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri',sans-serif;"&gt;Avg sales from 6 months before campaign start date for each agent.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 13:23:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63103#M779678</guid>
      <dc:creator>anindya_manna</dc:creator>
      <dc:date>2018-04-05T13:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63104#M779679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;I am trying to get &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #3d3d3d;"&gt;Avg sales from 6 months before campaign start date for each agent in a table&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11pt; font-family: Calibri, sans-serif; color: #3d3d3d;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 13:23:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63104#M779679</guid>
      <dc:creator>anindya_manna</dc:creator>
      <dc:date>2018-04-05T13:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63105#M779680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Anindya,&lt;/P&gt;&lt;P&gt;Few points here to clarify.&lt;/P&gt;&lt;P&gt;1. Your date formats between Processed Date and Campaign Start Date are different we need to convert them. However, your expr will show 0 or nothing coz your dates are not between the processed dates. Could be that you just gave sample data which is not matching.&lt;/P&gt;&lt;P&gt;2. Your sales field name is different form the data sample to that in the expression. Like in your expr you have [Sales Amt] but your sample data set has a field name Sales.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have created few date ID's to use them in your set analysis please have a look if this is of any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can we know why you are using P() here just wanted to understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Retrospective:&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="; color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; *, &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ProcessDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'M/D/YYYY')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;ProcessDtID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Floor&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CAMPAIGN_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'M/D/YYYY hh:mm:ss ttt'), 'M/D/YYYY')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CampaignDtID&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date#&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CAMPAIGN_START_DATE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'M/D/YYYY hh:mm:ss ttt'), 'M/D/YYYY') &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;CampaignStartDt&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;INLINE&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[&lt;BR /&gt; ProcessDate, CAMPAIGN_START_DATE, Sales, Agent ID &lt;BR /&gt; 1/1/2018, 2/1/2015 12:00:00 AM, 500, 111 &lt;BR /&gt; 1/2/2018, 5/1/2015 12:00:00 AM, 600, 222 &lt;BR /&gt; 1/3/2018, 5/13/2015 12:00:00 AM, 700, 333 &lt;BR /&gt; 1/4/2018, 5/21/2015 12:00:00 AM, 800, 444 &lt;BR /&gt; 1/5/2015, 5/29/2015 12:00:00 AM, 900, 555 &lt;BR /&gt; 1/6/2015, 6/2/2015 12:00:00 AM, 1000, 666 &lt;BR /&gt; 1/7/2015, 6/3/2015 12:00:00 AM, 1100, 777 &lt;BR /&gt; 1/8/2018, 6/9/2015 12:00:00 AM, 1200, 888 &lt;BR /&gt; 1/9/2018, 6/18/2015 12:00:00 AM, 1300, 999 &lt;BR /&gt; ]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;;&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;I used text object to check Avg sales. Changed few Process Dates to 2015 as all of them were in 2018 which always display 0 for Avg. so changed few dates that we can get some values. Check screenshot below. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;IMG __jive_id="198614" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/198614_pastedImage_4.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:08:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63105#M779680</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-04-05T14:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63106#M779681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem you have is you have strings in date than numeric dates..&lt;/P&gt;&lt;P&gt;May be try like below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;avg({&amp;lt;ProcessDate={"&amp;gt;=$(=Date(Addmonths(Floor(Date#(MAXString(CAMPAIGN_START_DATE), 'M/D/YYYY hh:mm:ss ttt')),-6), 'M/D/YYYY'))"}&amp;gt;}Sales)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:27:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63106#M779681</guid>
      <dc:creator>sasiparupudi1</dc:creator>
      <dc:date>2018-04-05T14:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63107#M779682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please attach your qvw?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63107#M779682</guid>
      <dc:creator>anindya_manna</dc:creator>
      <dc:date>2018-04-05T14:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63108#M779683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 14:37:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63108#M779683</guid>
      <dc:creator>vishsaggi</dc:creator>
      <dc:date>2018-04-05T14:37:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare two different field in set expression?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63109#M779684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;avg({$&amp;lt;[Process Date]={"&amp;gt;=$(=date(addmonths(CAMPAIGN_START_DATE,-6),'MM/DD/YYYY')) &amp;lt;$(=date(CAMPAIGN_START_DATE,'MM/DD/YYYY'))"}&amp;gt;}[Sales Amt])&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2018 13:28:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-compare-two-different-field-in-set-expression/m-p/63109#M779684</guid>
      <dc:creator>anindya_manna</dc:creator>
      <dc:date>2018-04-10T13:28:21Z</dc:date>
    </item>
  </channel>
</rss>

