<?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 with OR and MAX condition in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1694341#M53108</link>
    <description>&lt;P&gt;I just created this in the script editor instead.&lt;/P&gt;&lt;P&gt;1. I created a column for getting the latest record&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;TMP01:&lt;BR /&gt;Load*,&lt;BR /&gt;AutoNumber(recno(),cust_no) as s_no&lt;BR /&gt;RESIDENT CFB_TMP&lt;BR /&gt;ORDER BY cust_no, data_create_time desc;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;2. I then created the Tag&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Load*,&lt;BR /&gt;if(s_no=1 and&lt;SPAN&gt;EMP_FIELD='SE' AND INC_FIELD&amp;lt;&amp;gt;'SAL'&lt;/SPAN&gt;,'Self-Employed',&lt;BR /&gt;&amp;nbsp;If(s_no=1 and &lt;SPAN&gt;EMP_FIELD&amp;lt;&amp;gt;'SE' AND INC_FIELD='BI' AND OCC_FIELD LIKE '*BO*',&lt;/SPAN&gt;'Self-Employed','Employed'))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; as "Employed/Self-Employed Tag"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. And simply use this formula in the front end:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT&gt;Sum({&lt;/FONT&gt;&lt;FONT&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;SPAN&gt;trxn_desc={'LD'}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT&gt;[Employed/Self-Employed&lt;/FONT&gt;&lt;FONT&gt; Tag] = {"Self-Employed"}&amp;gt;} trxn_amt)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Works perfectly except that now my data model is taking too much time to load.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thank you!&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Apr 2020 07:49:13 GMT</pubDate>
    <dc:creator>Badzreyes00</dc:creator>
    <dc:date>2020-04-17T07:49:13Z</dc:date>
    <item>
      <title>Set Analysis with OR and MAX condition</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693778#M53073</link>
      <description>&lt;P&gt;Good day Everyone!&lt;/P&gt;&lt;P&gt;I am having trouble using Set Analysis and I hope you can help me with my issue:&lt;/P&gt;&lt;P&gt;I have a requirement where:&lt;/P&gt;&lt;P&gt;1. &lt;STRONG&gt;Sum of trxn_amt of all SE&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2.&lt;STRONG&gt; SE Rule&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EMP_FIELD&lt;/STRONG&gt; = 'SE' AND &lt;STRONG&gt;INC_FIELD&lt;/STRONG&gt; NOT 'SAL'&lt;/P&gt;&lt;P&gt;OR&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EMP_FIELD&lt;/STRONG&gt; NOT 'SE' AND&lt;STRONG&gt; INC_FIELD&lt;/STRONG&gt; =' BI' and&amp;nbsp; &lt;STRONG&gt;OCC_FIELD&lt;/STRONG&gt; like '*BO*' (Because there are values like BO-AA, BO-BB so I need to capture all 'BO')&lt;/P&gt;&lt;P&gt;And below is my set analysis:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT&gt;&amp;nbsp;sum(&lt;BR /&gt;{&amp;lt;trxn_desc={'LD'},serial_no={"=$(max(serial_no))"},EMP_FIELD={'SE'},INC_FIELD-={'SAL'}&amp;gt;+&amp;lt;INC_FIELD={'BI'},OCC_FIELD={"*BO*"}&amp;gt;} trxn_amt)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;trxn_desc = LD (my filter for correct type of transaction)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;serial_no = There are multiple records for each ID so I need to get the latest record for updated EMP_FIELD, INC_FIELD and OCC_FIELD&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Basically with that I need to get all EMP_FIELD=SE but INC_FIELD &amp;lt;&amp;gt; SAL &lt;STRONG&gt;OR&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;if EMP_FIELD &amp;lt;&amp;gt; SE then INC_FIELD=BI AND OCC_FIELD=BO&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I hope that I explained it clearly, thank you so much in advance for your help and have a good day!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 18:46:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693778#M53073</guid>
      <dc:creator>Badzreyes00</dc:creator>
      <dc:date>2024-11-16T18:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with OR and MAX condition</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693800#M53074</link>
      <description>&lt;P&gt;Not entirely sure as to what you are getting and what you are looking to get, but try this may be&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sum({&amp;lt;trxn_desc = {'LD'}, serial_no = {"$(=Max(serial_no))"}, EMP_FIELD ={'SE'}, INC_FIELD -= {'SAL'}&amp;gt;+&amp;lt;INC_FIELD = {'BI'}, OCC_FIELD = {"*BO*"}&amp;gt;} trxn_amt)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 18:17:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693800#M53074</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2020-04-15T18:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with OR and MAX condition</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693869#M53078</link>
      <description>&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;Thank you so much for your response.&lt;/P&gt;&lt;P&gt;Actually the problem is all the INC_FIELD and OCC_FIELD that I am getting are BI and BO only but I need to capture all INC_FIELD except SAL and ALL OCC_FIELD IF EMP_FIELD=SE and if NOT SE then INC_FIELD is BI only and OCC_FIELD is like BO only.&lt;/P&gt;&lt;TABLE width="281"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="74"&gt;EMP_FIELD&lt;/TD&gt;&lt;TD width="99"&gt;INC_FIELD&lt;/TD&gt;&lt;TD width="108"&gt;OCC_FIELD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;SE&lt;/TD&gt;&lt;TD&gt;ALL except SAL&lt;/TD&gt;&lt;TD&gt;ALL&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;if not SE&lt;/TD&gt;&lt;TD&gt;BI only&lt;/TD&gt;&lt;TD&gt;and like BO only&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so if I'll convert the expression after serial no. in IF statement it is something like below:&lt;/P&gt;&lt;P&gt;SUM(IF(&lt;/P&gt;&lt;P&gt;EMP_FIELD='SE' AND INC_FIELD&amp;lt;&amp;gt;'SAL',trxn_amt,&lt;/P&gt;&lt;P&gt;IF(EMP_FIELD&amp;lt;&amp;gt;'SE' AND INC_FIELD='BI' AND OCC_FIELD LIKE '*BO*',trxn_amt,0)))&lt;/P&gt;&lt;P&gt;So I am creating a pivot table with daily trxn_amt based on the conditions above. Thank you so much!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 01:35:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1693869#M53078</guid>
      <dc:creator>Badzreyes00</dc:creator>
      <dc:date>2020-04-16T01:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Set Analysis with OR and MAX condition</title>
      <link>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1694341#M53108</link>
      <description>&lt;P&gt;I just created this in the script editor instead.&lt;/P&gt;&lt;P&gt;1. I created a column for getting the latest record&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;TMP01:&lt;BR /&gt;Load*,&lt;BR /&gt;AutoNumber(recno(),cust_no) as s_no&lt;BR /&gt;RESIDENT CFB_TMP&lt;BR /&gt;ORDER BY cust_no, data_create_time desc;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;2. I then created the Tag&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Load*,&lt;BR /&gt;if(s_no=1 and&lt;SPAN&gt;EMP_FIELD='SE' AND INC_FIELD&amp;lt;&amp;gt;'SAL'&lt;/SPAN&gt;,'Self-Employed',&lt;BR /&gt;&amp;nbsp;If(s_no=1 and &lt;SPAN&gt;EMP_FIELD&amp;lt;&amp;gt;'SE' AND INC_FIELD='BI' AND OCC_FIELD LIKE '*BO*',&lt;/SPAN&gt;'Self-Employed','Employed'))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; as "Employed/Self-Employed Tag"&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3. And simply use this formula in the front end:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT&gt;Sum({&lt;/FONT&gt;&lt;FONT&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT&gt;&lt;FONT&gt;&lt;SPAN&gt;trxn_desc={'LD'}&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT&gt;[Employed/Self-Employed&lt;/FONT&gt;&lt;FONT&gt; Tag] = {"Self-Employed"}&amp;gt;} trxn_amt)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Works perfectly except that now my data model is taking too much time to load.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Thank you!&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 07:49:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-Analysis-with-OR-and-MAX-condition/m-p/1694341#M53108</guid>
      <dc:creator>Badzreyes00</dc:creator>
      <dc:date>2020-04-17T07:49:13Z</dc:date>
    </item>
  </channel>
</rss>

