<?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 pass multiple values in count expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579967#M739365</link>
    <description>I'm not sure I'm following what you are looking to do, but for starters, I'm assuming you are using the expression in the front end not the load script. Other than that there's a few issues with the syntax (possible it works)&lt;BR /&gt;&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={'vEMPNO'},[SECTION]={"$(vSECTION)"}&amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;to&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={"=$(vEMPNO)"},[SECTION]={"=$(vSECTION)"}&amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;&lt;BR /&gt;But I would imagine if the variables are formatted like vEMPNO=01,02,03 or '01','02','03' you could get rid of the "=" and just use EMPNO={$(vEMPNO)}</description>
    <pubDate>Tue, 14 May 2019 14:10:24 GMT</pubDate>
    <dc:creator>Jagsfan82</dc:creator>
    <dc:date>2019-05-14T14:10:24Z</dc:date>
    <item>
      <title>How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579827#M739362</link>
      <description>&lt;P&gt;I want to pass multiple values in my count expression.&lt;/P&gt;&lt;P&gt;LOAD * Inline [&lt;BR /&gt;EMPNO, SECTION&lt;BR /&gt;EA1,AA&lt;BR /&gt;EB1, BB&lt;BR /&gt;EC1, AA&lt;BR /&gt;ED1,CC&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;Actually my count expression is below.&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[EMPNO]={'vEMPNO'},[SECTION]={"$(vSECTION)"}&amp;gt;} DISTINCT [EMPNO])&lt;/P&gt;&lt;P&gt;I want to pass a variable "EMPNO" and "SECTION" as mentioned in count expression.&lt;/P&gt;&lt;P&gt;How to call the above two columns (EMPNO,SECTION) as variable...?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 03:35:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579827#M739362</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2024-11-16T03:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579843#M739363</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please elaborate what as a output you want. Do u want distinct value for both&amp;nbsp;&lt;SPAN&gt;EMPNO,SECTION ie for EMPNo EA1 and Section AA you want 1 as output.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kamal&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 May 2019 09:24:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579843#M739363</guid>
      <dc:creator>kamalqlik</dc:creator>
      <dc:date>2019-05-14T09:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579853#M739364</link>
      <description>Whatever values will be there in the column, I want to pass all the values. It is dynamic. It is like where clause of column name in (a,b,c,etc)...</description>
      <pubDate>Tue, 14 May 2019 09:55:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579853#M739364</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2019-05-14T09:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579967#M739365</link>
      <description>I'm not sure I'm following what you are looking to do, but for starters, I'm assuming you are using the expression in the front end not the load script. Other than that there's a few issues with the syntax (possible it works)&lt;BR /&gt;&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={'vEMPNO'},[SECTION]={"$(vSECTION)"}&amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;to&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={"=$(vEMPNO)"},[SECTION]={"=$(vSECTION)"}&amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;&lt;BR /&gt;But I would imagine if the variables are formatted like vEMPNO=01,02,03 or '01','02','03' you could get rid of the "=" and just use EMPNO={$(vEMPNO)}</description>
      <pubDate>Tue, 14 May 2019 14:10:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1579967#M739365</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2019-05-14T14:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580245#M739366</link>
      <description>&lt;P&gt;Thanks again..&lt;/P&gt;&lt;P&gt;How do we call this variable from another select/load statement..&lt;/P&gt;&lt;P&gt;Because this variable have to call from another SQL statement..?&lt;/P&gt;&lt;P&gt;How to do this..??&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 07:46:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580245#M739366</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2019-05-15T07:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580287#M739367</link>
      <description>Thanks again..&lt;BR /&gt;&lt;BR /&gt;How do we call this variable from another select/load statement..&lt;BR /&gt;&lt;BR /&gt;Because this variable have to call from another SQL statement..?&lt;BR /&gt;&lt;BR /&gt;How to do this..??</description>
      <pubDate>Wed, 15 May 2019 09:22:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580287#M739367</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2019-05-15T09:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580431#M739368</link>
      <description>&lt;P&gt;Set analysis cannot be used in the load script.&amp;nbsp; For what you are trying to do I would think you could design a simple loop to go back through your old table, but I also feel like there is probably a more elegant way to handle this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to Qlikview myself and never actually built a loop and make a lot of mistakes, but I would think you would need to utilize rowno() and peek(). Someone with more experience may be able to hone this in.&amp;nbsp; But something along the lines of the following (Which does not work)&lt;/P&gt;&lt;P&gt;Set your variables (May need to play with the single quotes to pass this correctly)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set vSECTION = 'AA';&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Set vEMPNO = 'EA1,EB1';&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Add a rowno() counter to your first table either manually or loading a new table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EmployeeTemp:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOAD * Inline [&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EMPNO, SECTION, RowNo&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EA1,AA,1&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EB1, BB,2&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;EC1, AA,3&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;ED1,CC,4&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;];&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;----OR----&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;EmployeeTable:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; EMPNO&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; SECTION&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; RowNo() as RowNo&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Resident EmployeeTemp&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And use peek to do your count.&amp;nbsp; Again someone would have to clean this up so it works properly.. haven't done loops yet.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Set vCount = 0;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Let vEmployeeRows = Peek(RowNo,-1,'EmployeeTable');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;For i=1 to $(vEmployeeRows)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; IF&amp;nbsp; &amp;nbsp;Match(Peek(EMPNO,i-1,'EmployeeTable'),$(vEMPNO)) AND Match(Peek(SECTION,i-1,'EmployeeTable'),$(vSECTION)) THEN&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; Let vCount = $(vCount)+1; //Is there a vCount+1 ability in Qlik?&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Next&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2019 13:02:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1580431#M739368</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2019-05-15T13:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1581053#M739370</link>
      <description>&lt;P&gt;i tried the below expression for single variable passing. but, it is not working.&lt;BR /&gt;Script :&lt;BR /&gt;TABLE1:&lt;BR /&gt;LOAD EMPNO,&lt;BR /&gt;EMPNAME,&lt;BR /&gt;EMPSECTION;&lt;BR /&gt;SQL SELECT *&lt;BR /&gt;FROM dbo."EmpDetails";&lt;BR /&gt;&lt;BR /&gt;i declared variable in the variable section and its below&lt;BR /&gt;vEmpNo = 'EMPNO';&lt;BR /&gt;&lt;BR /&gt;finally i used expression is below&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={$(vEMPNO)} &amp;gt;} DISTINCT [EMPNO])&lt;/P&gt;&lt;P&gt;For testing, i hardcoded value. it is working.&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[EMPNO]={'E101'} &amp;gt;} DISTINCT [EMPNO])&amp;nbsp; ==&amp;gt; &lt;U&gt;&lt;STRONG&gt;Working&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;=Count({&amp;lt;[EMPNO]={$(&lt;STRONG&gt;vEMPNO&lt;/STRONG&gt;)} &amp;gt;} DISTINCT [EMPNO]) ==&amp;gt; &lt;U&gt;&lt;STRONG&gt;Not Working ==&amp;gt;&amp;nbsp; (vEmpNo) value not set properly&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;where and what is problem and can anyone help regarding this..? This is very urgent.&lt;/P&gt;</description>
      <pubDate>Thu, 16 May 2019 13:33:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1581053#M739370</guid>
      <dc:creator>saivina2920</dc:creator>
      <dc:date>2019-05-16T13:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values in count expression</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1581303#M739371</link>
      <description>I'm still not 100% sure what you are looking for based on the expressions your giving me. It looks like you are trying to set the EMPNO field equal to all the values in EMPNO. Also not sure what you mean by vEmpNo = 'EMPNO'. That would be a string.&lt;BR /&gt;&lt;BR /&gt;I'm assuming by "Variable section" you mean variable overview window? (CTRL+ALT+V)&lt;BR /&gt;&lt;BR /&gt;If you want all the values in a field you can try to use the following as the variable:&lt;BR /&gt;&lt;BR /&gt;='{'&amp;amp;Concat(DISTINCT EMPNO,'}+{')&amp;amp;'}'&lt;BR /&gt;&lt;BR /&gt;That should expand out to include all distinct values in the field EMPNO and work in your set analysis. But again, I can't envision what you are trying to achieve?&lt;BR /&gt;&lt;BR /&gt;=Count({&amp;lt;[EMPNO]=$(vEMPNO) &amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;will expand to something like&lt;BR /&gt;=Count({&amp;lt;[EMPNO]={E101}+{E102}+{E103} &amp;gt;} DISTINCT [EMPNO])&lt;BR /&gt;&lt;BR /&gt;Again anything else that could make it more clear what you are trying to achieve would be helpful</description>
      <pubDate>Thu, 16 May 2019 22:06:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-pass-multiple-values-in-count-expression/m-p/1581303#M739371</guid>
      <dc:creator>Jagsfan82</dc:creator>
      <dc:date>2019-05-16T22:06:16Z</dc:date>
    </item>
  </channel>
</rss>

