<?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 if count in Search the Community</title>
    <link>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1776234#M5</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i am relatively new to the tool so any help will be much appreciated. I wanna assign a string when a customer code appears 1, between 1 and 5 or a number &amp;gt;5.&lt;/P&gt;&lt;P&gt;The classic excel logic would look like this:&lt;/P&gt;&lt;P&gt;if( [state] = 'payed',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) = 1, 'One timer',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) &amp;gt; 1 and count([customer]) &amp;lt; 5, 'Medium user', 'Heavy user')),'')&lt;/P&gt;&lt;P&gt;I know that putting if and a count in this order doen not work here and i could not find a suitable solution between the post i have seen. Can someone give me some suggestion on how to obtain the result?&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2021 09:37:32 GMT</pubDate>
    <dc:creator>Power</dc:creator>
    <dc:date>2021-01-21T09:37:32Z</dc:date>
    <item>
      <title>if count</title>
      <link>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1776234#M5</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i am relatively new to the tool so any help will be much appreciated. I wanna assign a string when a customer code appears 1, between 1 and 5 or a number &amp;gt;5.&lt;/P&gt;&lt;P&gt;The classic excel logic would look like this:&lt;/P&gt;&lt;P&gt;if( [state] = 'payed',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) = 1, 'One timer',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) &amp;gt; 1 and count([customer]) &amp;lt; 5, 'Medium user', 'Heavy user')),'')&lt;/P&gt;&lt;P&gt;I know that putting if and a count in this order doen not work here and i could not find a suitable solution between the post i have seen. Can someone give me some suggestion on how to obtain the result?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 09:37:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1776234#M5</guid>
      <dc:creator>Power</dc:creator>
      <dc:date>2021-01-21T09:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: if count</title>
      <link>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1776252#M6</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/112971"&gt;@Power&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try like below&lt;/P&gt;&lt;P&gt;Load yourprimarykeyfield,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if( [state] = 'payed',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) = 1, 'One timer',&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) &amp;gt; 1 and count([customer]) &amp;lt; 5, 'Medium user', 'Heavy user')),'') as UsrType&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Resident ursourcetablename&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;group by&amp;nbsp;yourprimarykeyfield;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Then in front end, u can use&amp;nbsp;UsrType as ur dimension.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;---------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Suppose, u want to achieve only in front end. try like below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Aggr(if( [state] = 'payed',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) = 1, 'One timer',&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if( count([customer]) &amp;gt; 1 and count([customer]) &amp;lt; 5, 'Medium user', 'Heavy user')),''), UrPrimaryFieldName)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For performance wise, try in backend.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 10:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1776252#M6</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2021-01-21T10:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: if count</title>
      <link>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1777036#M10</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/17935"&gt;@MayilVahanan&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your answer. I tried it, can you specify where should i put it in the editor in order to make it work properly. I couldn't. I am tryin to learn and solve things in different ways. In this particular case i would like not to break the autogenerated code in the editor, so can i put the new variables etc. in a manually generated section and then load the whole script expecting it to work?&lt;/P&gt;&lt;P&gt;Thanks in advance for your time, i know some of my points could sound obvious.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 09:22:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Search-the-Community/if-count/m-p/1777036#M10</guid>
      <dc:creator>Power</dc:creator>
      <dc:date>2021-01-25T09:22:18Z</dc:date>
    </item>
  </channel>
</rss>

