<?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 Set Analysis with Field = Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268687#M100855</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; PrevWAC and CurrWAC are in the same table.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Feb 2012 17:09:34 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-02-09T17:09:34Z</dc:date>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268681#M100849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to wirte a set analysis statement for the sum where two fields have equal values.&amp;nbsp; &lt;/P&gt;&lt;P&gt;I am using the syntax&amp;nbsp; ﻿sum({&amp;lt;PrevWAC -= CurrWAC&amp;gt;} Balance) this returns the value equal to sum(Balance) so it is ignoring the set statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use an If statement of If(PrevWAC &amp;lt;&amp;gt; CurrWAC, sum(Balance), 0) in a straight table with the dimensions of 'account', 'PrevWAC', 'CurrWAC' the table shows the sum where PrevWAC is not equal to the CurrWAC at the account level and the total sum of rows gives me the correct answer. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot figure out why the If statement works and the Set Analysis does not.&amp;nbsp; I need to use Set Analysis because this is just one part of the statement I am trying to create.&amp;nbsp; I have searched the posts and tried every solution idea I could find.&amp;nbsp; Any Ideas?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You&lt;/P&gt;&lt;P&gt;Patrick&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:31:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268681#M100849</guid>
      <dc:creator />
      <dc:date>2012-02-09T16:31:26Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268682#M100850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; you can try with this..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;sum({&amp;lt;PrevWAC -= {CurrWAC}&amp;gt;} Balance) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #636363; font-family: Arial; font-size: 12px; background-color: #eef4f9;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:51:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268682#M100850</guid>
      <dc:creator>CELAMBARASAN</dc:creator>
      <dc:date>2012-02-09T16:51:07Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268683#M100851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your "set" is likely to include everything, if for each selection of PrevWAC there is value in CurrWAC which is not equal to PrevWAC.&lt;BR /&gt;Try this:&lt;BR /&gt;﻿sum({-&amp;lt;PrevWAC = P(CurrWAC)&amp;gt;} Balance) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Michael&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:55:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268683#M100851</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-09T16:55:16Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268684#M100852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply, but I did try that and it does not work.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried &lt;/P&gt;&lt;P&gt;sum({&amp;lt;PrevWAC = P(CurrWAC)&amp;gt;}Balance)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 16:56:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268684#M100852</guid>
      <dc:creator />
      <dc:date>2012-02-09T16:56:34Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268685#M100853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is PrevWAC and CurrWAC in the same table? If it is it might be able to create a flag in the script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if (PrevWAC&amp;lt;&amp;gt;CurrWAC,1) as Flag&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then in the table&lt;/P&gt;&lt;P&gt; sum({&amp;lt;Flag={'1'}&amp;gt;} Balance)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:00:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268685#M100853</guid>
      <dc:creator />
      <dc:date>2012-02-09T17:00:47Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268686#M100854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I tried sum({-&amp;lt;PrevWAC = P(CurrWAC&amp;gt;}Balance) which gave me a new number but the not the one I am looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each 'account' has one value for 'PrevWAC' and 'CurrWAC' .&amp;nbsp; I need the sum only for the accounts where PrevWAC and CurrWAC are the same.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:06:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268686#M100854</guid>
      <dc:creator />
      <dc:date>2012-02-09T17:06:58Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268687#M100855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; PrevWAC and CurrWAC are in the same table.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:09:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268687#M100855</guid>
      <dc:creator />
      <dc:date>2012-02-09T17:09:34Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268688#M100856</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now it is not quite clear...&lt;/P&gt;&lt;P&gt;Could you please post an example of data in table format, with columns PrevWAC, CurrWAC, Balance, and the desired result?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 17:37:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268688#M100856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-09T17:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268689#M100857</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;﻿To clarify there is an entry in the table for each month, for each account, that has a value for PrevWAC and CurrWAC.&amp;nbsp; When PrevWAC and CurrWAC are different on an entry I want to sum those balances for each month.&amp;nbsp; I have been including the month value in the set analysis, which works fine.&amp;nbsp; I hope the attachment helps.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 19:14:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268689#M100857</guid>
      <dc:creator />
      <dc:date>2012-02-09T19:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268690#M100858</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DId you try making a flag like I suggested?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD "month_date",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MonthEnd("month_date") as EndOfMonth,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; account,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CurrBal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; BalChg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrevWAC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CurrWAC,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(PrevWAC&amp;lt;&amp;gt;CurrWAC,1) as Flag;&lt;/P&gt;&lt;P&gt;SQL SELECT *&lt;/P&gt;&lt;P&gt;FROM SDM.dbo."cpi_roll_on_off"&lt;/P&gt;&lt;P&gt;where ProdGroup = 'ARM-4X1';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the Set analysis would just be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({&amp;lt;Flag={'1'}&amp;gt;}CurrBal)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 19:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268690#M100858</guid>
      <dc:creator />
      <dc:date>2012-02-09T19:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268691#M100859</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; I tried the flag and it did work that way.&amp;nbsp; Thank you.&amp;nbsp; Curious on why it doesn't work the other way.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 20:27:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268691#M100859</guid>
      <dc:creator />
      <dc:date>2012-02-09T20:27:35Z</dc:date>
    </item>
    <item>
      <title>Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268692#M100860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; It works for the same reason the "if" expression works.&amp;nbsp; As for the "set" - I don't see an easy way here, and recommend the flag or "if".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 21:34:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268692#M100860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-09T21:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268693#M100861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the flag and was able to integrate it into my file fine.&amp;nbsp; Thank you all for your help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Feb 2012 21:54:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/268693#M100861</guid>
      <dc:creator />
      <dc:date>2012-02-09T21:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with Field = Field</title>
      <link>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/2041061#M1222716</link>
      <description>&lt;P&gt;Here's the sample load:&lt;/P&gt;
&lt;P&gt;tmp:NoConcatenate&lt;BR /&gt;load * inline&lt;/P&gt;
&lt;P&gt;[_RecordID,fld1,fld2,balance&lt;BR /&gt;1,1,1,10&lt;BR /&gt;2,1,2,10&lt;BR /&gt;3,2,2,20&lt;BR /&gt;4,3,2,10&lt;BR /&gt;5,4,2,5&lt;BR /&gt;6,5,5,5&lt;BR /&gt;];&lt;/P&gt;
&lt;P&gt;_RecordID is unique for each row in the table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the chat expression:&lt;/P&gt;
&lt;P&gt;sum({$&amp;lt;[_RecordID]={"=fld1&amp;lt;&amp;gt;fld2"}&amp;gt;}balance)&lt;/P&gt;
&lt;P&gt;Explanation: Return the _RecordID, when fld1 is not equal to fld2, then sum the balance.&lt;/P&gt;
&lt;P&gt;This compare the two field and return _RecordID, which identify balance value on that row.&lt;/P&gt;
&lt;P&gt;This works great as longa s _RecordID is unique, otherwise the return will find all _RecordID matching and sum its balance.&lt;/P&gt;
&lt;P&gt;sum({$&amp;lt;UID= {"=PrevWAC &amp;lt;&amp;gt;CurrWAC"}&amp;gt;}Balance)&lt;/P&gt;
&lt;P&gt;replace UID with your table's unique row id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 16:46:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-Analysis-with-Field-Field/m-p/2041061#M1222716</guid>
      <dc:creator>hoangvvo</dc:creator>
      <dc:date>2023-02-22T16:46:38Z</dc:date>
    </item>
  </channel>
</rss>

