<?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 Counting instances in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278797#M1203009</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So for that data, we should see these kinds of numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="128"&gt;&lt;COL span="2" style="width:48pt;" width="64" /&gt;&lt;TBODY&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;width:48pt;" width="64"&gt;Number with 1&lt;/TD&gt;&lt;TD align="right" style="width:48pt;" width="64"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 2 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;201&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 3 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 4 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Sum 299&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I'm getting a total of 546 using the expression count(combination)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 16:47:42 GMT</pubDate>
    <dc:creator />
    <dc:date>2010-09-23T16:47:42Z</dc:date>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278787#M1202999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First let me explain what kind of data I'm working with.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The original data set has the following variables and setups&lt;/P&gt;&lt;P&gt;[Taxonomy Category], Diag1, [Diag1 Category], Diag2, [Diag2 Category], Diag3, [Diag3 Category], Diag4, [Diag4 Category]&lt;/P&gt;&lt;P&gt;All of the categories are text and have 20 to 50 different categories. All of the Diag (Diagnosis Codes) are codes, mostly numeric, some with a letter at the beginning (ie E909).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 versions of the qualified data (partly because I don't know how to get a combined version)&lt;/P&gt;&lt;P&gt;DiagnosisTable:&lt;BR /&gt;CROSSTABLE (ICD, ICDCategory, 2)&lt;BR /&gt;LOAD recno() as ID, [Taxonomy Category],&lt;BR /&gt; [Diag1 Cat],&lt;BR /&gt; [Diag2 Cat],&lt;BR /&gt; [Diag3 Cat],&lt;BR /&gt; [Diag4 Cat]&lt;BR /&gt;Resident RawDiagnosisTable;&lt;BR /&gt;&lt;BR /&gt;DiagnosisCode:&lt;BR /&gt;Crosstable (ICDDes, ICDNumber, 2)&lt;BR /&gt;Load recno() as CodeNumber, [Taxonomy Category],&lt;BR /&gt; Diag1,&lt;BR /&gt; Diag2,&lt;BR /&gt; Diag3,&lt;BR /&gt; Diag4&lt;BR /&gt;Resident RawDiagnosisTable;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to explore the combinations of nonblank cells between the diagnosis codes by row.&lt;/P&gt;&lt;P&gt;For example, how many rows have values in Diag1 AND Diag2, how many with Diag1 and diag2 and diag3? etc&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know in Excel you can use a function called COUNTBLANK and a few if/then statements to achieve this effect with the original data structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Qlikview I am not aware of a function that can do this, nor am I well acquainted with the syntax for expressions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone help?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 20:36:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278787#M1202999</guid>
      <dc:creator />
      <dc:date>2010-09-22T20:36:28Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278788#M1203000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be the equivalent to COUNTBLANK in QlikView:&lt;/P&gt;&lt;P&gt;count(if(trim([Diag1])='' or isnull([Diag1]),[Diag1]))&lt;/P&gt;&lt;P&gt;because count(null()) = 0 and the if statement returns null if the condition is not met and you don't define a value when the condition is false.&lt;/P&gt;&lt;P&gt;so to count how many rows have values in Diag1 and Diag2 you could try&lt;/P&gt;&lt;P&gt;count(ICDNumber)&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;count(if(trim([Diag1]&amp;amp;[Diag2])='' or (isnull([Diag1]) and isnull([Diag2])),[Diag1]&amp;amp;[Diag2]))&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 21:33:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278788#M1203000</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-09-22T21:33:19Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278789#M1203001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you're working with your new tables instead of your raw table, maybe something like this to count how many with Diag1, Diag2 and Diag3?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;-sum(aggr(count({&amp;lt;ICDDes={'Diag1','Diag2','Diag3'}&amp;gt;} distinct ICDDes)=3,CodeNumber))&lt;/P&gt;&lt;P&gt;The set analysis says we're "selecting" the three diagnosis codes of interest. The aggr(...,CodeNumber) says we're making a "table" by CodeNumber. For each row in this table, we check to see if the number of distinct diagnosis codes is 3, which means that that "row" has all three diagnosis codes of interest. A "true" value is -1, so if we sum these up through the whole table, then flip the sign, we should have a count of all CodeNumbers that have these three diagnosis codes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 21:49:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278789#M1203001</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-22T21:49:14Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278790#M1203002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hmm&lt;/P&gt;&lt;P&gt;What kind of dimension would you recommend I set up with that?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 21:54:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278790#M1203002</guid>
      <dc:creator />
      <dc:date>2010-09-22T21:54:45Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278791#M1203003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm sorry; I don't understand the question. If you want a count of the number of rows with those three codes, that's just a single number. There's no dimension implied. You can have a dimension if you want. I just wouldn't have any idea what dimension you might want.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 21:59:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278791#M1203003</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-22T21:59:52Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278792#M1203004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well at some point I would like to have them grouped.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think for now, selecting which chart to show this in is the better question for me. Because I cannot get any output to display for either answer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 22:02:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278792#M1203004</guid>
      <dc:creator />
      <dc:date>2010-09-22T22:02:32Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278793#M1203005</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess to better explain, the output I am looking for is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Combo Count&lt;/P&gt;&lt;P&gt;1-2&lt;/P&gt;&lt;P&gt;1-3&lt;/P&gt;&lt;P&gt;1-4&lt;/P&gt;&lt;P&gt;2-3&lt;/P&gt;&lt;P&gt;3-4&lt;/P&gt;&lt;P&gt;1-2-3&lt;/P&gt;&lt;P&gt;2-3-4&lt;/P&gt;&lt;P&gt;... and so forth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And somewhere down the line be able throw a sort to where I can look at persay all the combos in a specific Taxonomy or all the combos for a specific Diagnosis Category.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 22:05:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278793#M1203005</guid>
      <dc:creator />
      <dc:date>2010-09-22T22:05:26Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278794#M1203006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, so you want to see every POSSIBLE combination of at least two diagnostic codes? All of these? As values for a dimension?&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;12&lt;BR /&gt;13&lt;BR /&gt;14&lt;BR /&gt;23&lt;BR /&gt;24&lt;BR /&gt;34&lt;BR /&gt;123&lt;BR /&gt;124&lt;BR /&gt;134&lt;BR /&gt;234&lt;BR /&gt;1234&lt;/P&gt;&lt;P&gt;I don't know of any good way to make QlikView iterate over all the combinations of a dimension's values as a dimension. Below is pure brute force, but it might work, particularly since the number of combinations is small enough to get away with this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;AllCombinations:&lt;BR /&gt;CROSSTABLE (Combination,Exists)&lt;BR /&gt;LOAD&lt;BR /&gt; "Taxonomy Category"&lt;BR /&gt;,len(Diag1) and len(Diag2) as "12"&lt;BR /&gt;,len(Diag1) and len(Diag3) as "13"&lt;BR /&gt;...&lt;BR /&gt;,len(Diag1) and len(Diag2) and len(Diag3) and len(Diag4) as "1234"&lt;BR /&gt;RESIDENT RawDiagnosisTable&lt;BR /&gt;;&lt;BR /&gt;INNER JOIN (AllCombinations)&lt;BR /&gt;LOAD -1 as Exists&lt;BR /&gt;AUTOGENERATE 1&lt;BR /&gt;;&lt;BR /&gt;DROP FIELD Exists&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;At this point, AllCombinations should be a linkage table between the Taxonomy Category and all existing combinations of your diagnosis codes. At that point, you should be able to do this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;Dimension = Combination&lt;BR /&gt;Expression = count(distinct "Taxonomy Category")&lt;/P&gt;&lt;P&gt;All of this is very untested. If it doesn't work like I wrote it and you can't fix it, maybe upload a file with some sample data for me to fiddle with.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 22:43:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278794#M1203006</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-22T22:43:41Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278795#M1203007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, creating the dimensions worked perfectly:&lt;/P&gt;&lt;P&gt;AllCombinations:&lt;BR /&gt;Replace&lt;BR /&gt;CROSSTABLE (Combination,Exists)&lt;BR /&gt;LOAD "Taxonomy Category",&lt;BR /&gt;len(Diag1) and len(Diag2) as "12",&lt;BR /&gt;len(Diag1) and len(Diag3) as "13",&lt;BR /&gt;len(Diag1) and len(Diag4) as "14",&lt;BR /&gt;len(Diag2) and len(Diag3) as "23",&lt;BR /&gt;len(Diag2) and len(Diag4) as "24",&lt;BR /&gt;len(Diag3) and len(Diag4) as "34",&lt;BR /&gt;len(Diag1) and len(Diag2) and len(Diag3) as "123",&lt;BR /&gt;len(Diag1) and len(Diag2) and len(Diag4) as "124",&lt;BR /&gt;len(Diag1) and len(Diag3) and len(Diag4) as "134",&lt;BR /&gt;len(Diag2) and len(Diag3) and len(Diag4) as "234",&lt;BR /&gt;len(Diag1) and len(Diag2) and len(Diag3) and len(Diag4) as "1234"&lt;BR /&gt;RESIDENT RawDiagnosisTable;&lt;BR /&gt;&lt;BR /&gt;INNER JOIN (AllCombinations)&lt;BR /&gt;LOAD -1 as Exists AUTOGENERATE 1;&lt;BR /&gt;DROP FIELD Exists;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it's not counting correctly.&lt;/P&gt;&lt;P&gt;When I use distinct it returns 6 (the number of taxonomies I have currently loaded in the file) and when I remove it, enters in the total in every entry for the dimension. I thought perhaps it was because that Taxonomy is now a "key" value and wasn't counting the correct field, but turns out that wasn't the case I don't think.&lt;/P&gt;&lt;P&gt;I did attach the excel file (a much smaller version) but there's 100 rows from 3 different taxonomies.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:42:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278795#M1203007</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:42:33Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278796#M1203008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Disregard that previous sample, use this one instead:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:47:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278796#M1203008</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:47:32Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278797#M1203009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So for that data, we should see these kinds of numbers:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="128"&gt;&lt;COL span="2" style="width:48pt;" width="64" /&gt;&lt;TBODY&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;width:48pt;" width="64"&gt;Number with 1&lt;/TD&gt;&lt;TD align="right" style="width:48pt;" width="64"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 2 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;201&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 3 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="height:12.75pt;"&gt;&lt;TD align="right" height="17" style="height:12.75pt;"&gt;Number with 4 pairs&lt;BR /&gt;&lt;/TD&gt;&lt;TD align="right"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Sum 299&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I'm getting a total of 546 using the expression count(combination)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 16:47:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278797#M1203009</guid>
      <dc:creator />
      <dc:date>2010-09-23T16:47:42Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278798#M1203010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I know the reason why we're seeing 546 counts instead of 299.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Consider a row that has entries in Diag1, Diag2, Diag3, Diag4.&lt;/P&gt;&lt;P&gt;I have a suspicion that for this row (and others), it is counting it for all combinations, thus a count for&lt;/P&gt;&lt;P&gt;1-2&lt;/P&gt;&lt;P&gt;2-3&lt;/P&gt;&lt;P&gt;3-4&lt;/P&gt;&lt;P&gt;1-4 ... and so forth. In other words, the row is not given a distinct label.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do we remedy that?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 18:29:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278798#M1203010</guid>
      <dc:creator />
      <dc:date>2010-09-23T18:29:50Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278799#M1203011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your suspicion is correct. That's what I was TRYING to do, and what made everything complicated. OK, just because we've come this far, to do what I was thinking with what your data really looks like, you just need to add an ID for the row, and to use the ID instead of the Taxonomy Category when building the extra table. I have that working just fine in an example with your data.&lt;/P&gt;&lt;P&gt;But I didn't realize you wanted a DISTINCT label for the row. That's why I have a separate table. I thought you WANTED to see all those combinations. If you only want a distinct label for the row, that's TRIVIAL by comparison.&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;if(len(Diag1),'1')&amp;amp;if(len(Diag2),'2')&amp;amp;if(len(Diag3),'3')&amp;amp;if(len(Diag4),'4') as Combination&lt;/P&gt;&lt;P&gt;Is that what you mean?&lt;/P&gt;&lt;P&gt;And actually, it looks like you ALWAYS fill in the codes from left to right? If so, then the ONLY possible combinations are these:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;1&lt;BR /&gt;12&lt;BR /&gt;123&lt;BR /&gt;1234&lt;/P&gt;&lt;P&gt;NOT the ones we both listed before. And at that point, all you're doing is counting the number of diagnostic codes. You might as well just do this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;-rangesum(len(Diag1)&amp;gt;0,len(Diag2)&amp;gt;0,len(Diag3)&amp;gt;0,len(Diag4)&amp;gt;0) as NumberOfCodes&lt;/P&gt;&lt;P&gt;Here's every single one of those approaches. Maybe what you're asking for is one of them. Maybe not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 18:58:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278799#M1203011</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-23T18:58:12Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278800#M1203012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well I can't view your document unfortunately,&lt;/P&gt;&lt;P&gt;But yes I do want to see all of the combinations because we don't know a great deal about the data we're playing with. Maybe for this 300 that's how it worked out, but for the other 2 mil+ it might not be, maybe it's different in another taxonomy, I don't know yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You gave me an idea though, which is what I think you were trying to tell me in your last post.&lt;/P&gt;&lt;P&gt;RawDiagnosisTable:&lt;BR /&gt;LOAD [Taxonomy Category],&lt;BR /&gt; [Diag1 Cat], [Diag2 Cat], [Diag3 Cat], [Diag4 Cat],&lt;BR /&gt; Diag1, Diag2, Diag3, Diag4,&lt;BR /&gt; if(len(Diag1),'1')&amp;amp;if(len(Diag2),'2')&amp;amp;if(len(Diag3),'3')&amp;amp;if(len(Diag4),'4') as Combination&lt;BR /&gt;FROM C:\Users\kkorynta\Desktop\Sample.xlsx&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Load * Inline [Combination&lt;BR /&gt;12,&lt;BR /&gt;13,&lt;BR /&gt;14,&lt;BR /&gt;13,&lt;BR /&gt;14,&lt;BR /&gt;23,&lt;BR /&gt;24,&lt;BR /&gt;34,&lt;BR /&gt;123,&lt;BR /&gt;124,&lt;BR /&gt;134,&lt;BR /&gt;234,&lt;BR /&gt;1234&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;My output is a little funky though which I see why you mentioned it looked like it only loads from left to right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE bgcolor="white" border="1" cellpadding="0" cellspacing="0" style="font-size:9pt;"&gt;&lt;TBODY&gt;&lt;TR align="left"&gt;&lt;TH nowrap="nowrap"&gt;&lt;B&gt;Combination&lt;/B&gt; &lt;B&gt;&lt;/B&gt;&lt;/TH&gt;&lt;TH nowrap="nowrap"&gt;&lt;B&gt;Count (Combination)&lt;/B&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="#F5F5F5"&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD bgcolor="#F5F5F5"&gt;&lt;B&gt;307&lt;/B&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;TD bgcolor="white"&gt;45&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;12&lt;/TD&gt;&lt;TD bgcolor="white"&gt;201&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;13&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;14&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;23&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;24&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;34&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;123&lt;/TD&gt;&lt;TD bgcolor="white"&gt;34&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;124&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;134&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;234&lt;/TD&gt;&lt;TD bgcolor="white"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR align="right"&gt;&lt;TD bgcolor="white"&gt;1234&lt;/TD&gt;&lt;TD bgcolor="white"&gt;19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;What I don't understand, is how/why the combos with a count of 1 are reported that way, shouldn't they show as zeros? Otherwise, yes this is what I was looking for.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 19:24:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278800#M1203012</guid>
      <dc:creator />
      <dc:date>2010-09-23T19:24:25Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278801#M1203013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To make up for my poor answer yesterday, here's some script you can try:&lt;/P&gt;&lt;P&gt;SET ThousandSep=',';&lt;BR /&gt;SET DecimalSep='.';&lt;BR /&gt;SET MoneyThousandSep=',';&lt;BR /&gt;SET MoneyDecimalSep='.';&lt;BR /&gt;SET MoneyFormat='$#,##0.00;-$#,##0.00';&lt;BR /&gt;SET TimeFormat='hh:mm:ss TT';&lt;BR /&gt;SET DateFormat='DD/MM/YYYY';&lt;BR /&gt;SET TimestampFormat='DD/MM/YYYY hh:mm:ss[.fff] TT';&lt;BR /&gt;SET MonthNames='ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic';&lt;BR /&gt;SET DayNames='lun;mar;mié;jue;vie;sáb;dom';&lt;/P&gt;&lt;P&gt;Tmp_Mapeo:&lt;BR /&gt;LOAD * INLINE [&lt;BR /&gt; Combination_Num, Map&lt;BR /&gt; 1, 1 Pair&lt;BR /&gt; 2, 1 Pair&lt;BR /&gt; 3, 1 Pair&lt;BR /&gt; 4, 1 Pair&lt;BR /&gt; 12, 2 Pair&lt;BR /&gt; 13, 2 Pair&lt;BR /&gt; 14, 2 Pair&lt;BR /&gt; 23, 2 Pair&lt;BR /&gt; 24, 2 Pair&lt;BR /&gt; 34, 2 Pair&lt;BR /&gt; 123, 3 Pair&lt;BR /&gt; 124, 3 Pair&lt;BR /&gt; 234, 3 Pair&lt;BR /&gt; 1234, 4 Pair&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;RawDiagnosisTable:&lt;BR /&gt;LOAD rowno() as RowID,&lt;BR /&gt; [Taxonomy Category],&lt;BR /&gt; Diag1,&lt;BR /&gt; [Diag1 Cat],&lt;BR /&gt; Diag2,&lt;BR /&gt; [Diag2 Cat],&lt;BR /&gt; Diag3,&lt;BR /&gt; [Diag3 Cat],&lt;BR /&gt; Diag4,&lt;BR /&gt; [Diag4 Cat]&lt;BR /&gt;FROM&lt;BR /&gt;Sample.xlsx&lt;BR /&gt;(ooxml, embedded labels, table is Sheet1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AllCombinations:&lt;BR /&gt;Replace&lt;BR /&gt;CROSSTABLE (Combination,Exists,2)&lt;BR /&gt;LOAD RowID,&lt;BR /&gt;"Taxonomy Category",&lt;BR /&gt;len(Diag1) and not len(Diag2) and not (len(Diag3)) and not (len(Diag4)) as "1",&lt;BR /&gt;not len(Diag1) and len(Diag2) and not (len(Diag3)) and not (len(Diag4)) as "2",&lt;BR /&gt;not len(Diag1) and not len(Diag2) and (len(Diag3)) and not (len(Diag4)) as "3",&lt;BR /&gt;not len(Diag1) and not len(Diag2) and not (len(Diag3)) and (len(Diag4)) as "4",&lt;BR /&gt;len(Diag1) and len(Diag2) and not (len(Diag3)) and not (len(Diag4)) as "12",&lt;BR /&gt;len(Diag1) and not len(Diag2) and (len(Diag3)) and not (len(Diag4)) as "13",&lt;BR /&gt;len(Diag1) and not len(Diag2) and not (len(Diag3)) and (len(Diag4)) as "14",&lt;BR /&gt;not len(Diag1) and len(Diag2) and (len(Diag3)) and not (len(Diag4)) as "23",&lt;BR /&gt;not len(Diag1) and len(Diag2) and not (len(Diag3)) and (len(Diag4)) as "24",&lt;BR /&gt;not len(Diag1) and not len(Diag2) and (len(Diag3)) and (len(Diag4)) as "34",&lt;BR /&gt;len(Diag1) and len(Diag2) and len(Diag3) and not (len(Diag4)) as "123",&lt;BR /&gt;len(Diag1) and len(Diag2) and not (len(Diag3)) and len(Diag4) as "124",&lt;BR /&gt;len(Diag1) and not (len(Diag2)) and len(Diag3) and len(Diag4) as "134",&lt;BR /&gt;not (len(Diag1)) and len(Diag2) and len(Diag3) and len(Diag4) as "234",&lt;BR /&gt;len(Diag1) and len(Diag2) and len(Diag3) and len(Diag4) as "1234"&lt;BR /&gt;RESIDENT RawDiagnosisTable;&lt;/P&gt;&lt;P&gt;INNER JOIN (AllCombinations)&lt;BR /&gt;LOAD -1 as Exists AUTOGENERATE 1;&lt;BR /&gt;DROP FIELD Exists;&lt;/P&gt;&lt;P&gt;LEFT JOIN&lt;BR /&gt;LOAD text(Combination_Num) as Combination,&lt;BR /&gt;Map&lt;BR /&gt;Resident Tmp_Mapeo;&lt;/P&gt;&lt;P&gt;Drop table Tmp_Mapeo;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 19:29:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278801#M1203013</guid>
      <dc:creator>pover</dc:creator>
      <dc:date>2010-09-23T19:29:10Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278802#M1203014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="jive_text_macro jive_macro_quote" jivemacro="quote"&gt;&lt;BR /&gt;bryankoch wrote:What I don't understand, is how/why the combos with a count of 1 are reported that way, shouldn't they show as zeros?&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;Remove the inline table of possible combinations. I suspect that will fix the results. I think what's happening is that even when the combination doesn't exist in your diagnosis table, it's still counting the one occurrence in your inline table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 19:36:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278802#M1203014</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-09-23T19:36:59Z</dc:date>
    </item>
    <item>
      <title>Counting instances</title>
      <link>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278803#M1203015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Figured my little issue out with the counts. I overlooked that I was using a Key, which was counting from the other table. &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; Otherwise, using&lt;/P&gt;&lt;P&gt;if(len(Diag1),'1')&amp;amp;if(len(Diag2),'2')&amp;amp;if(len(Diag3),'3')&amp;amp;if(len(Diag4),'4') as Combinations, in my load statement with&lt;/P&gt;&lt;P&gt;Load * Inline [Combination&lt;BR /&gt;12,&lt;BR /&gt;13,&lt;BR /&gt;14,&lt;BR /&gt;13,&lt;BR /&gt;14,&lt;BR /&gt;23,&lt;BR /&gt;24,&lt;BR /&gt;34,&lt;BR /&gt;123,&lt;BR /&gt;124,&lt;BR /&gt;134,&lt;BR /&gt;234,&lt;BR /&gt;1234&lt;BR /&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Showed me what I needed to know.&lt;/P&gt;&lt;P&gt;John, thanks for all the help. I really appreciate it, and if sometime in the near future I need to see all possible combinations within the row I'll know how!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And Karl, I tried yours and it works as well.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 19:40:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Counting-instances/m-p/278803#M1203015</guid>
      <dc:creator />
      <dc:date>2010-09-23T19:40:15Z</dc:date>
    </item>
  </channel>
</rss>

