<?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: Crosstable is duplicating binary fields in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Crosstable-is-duplicating-binary-fields/m-p/1959171#M79064</link>
    <description>&lt;P&gt;Looks like you got some more qualifying columns in your table,&amp;nbsp; along with that it may be making sense to have both 0 and 1 value for one condition. Check out the third parameter in the crosstable function, you may like to have that. Otherwise its not making sense to me having patient 0 both yes and no for a single condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/work-with-cross-tables.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/work-with-cross-tables.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 01:14:50 GMT</pubDate>
    <dc:creator>Digvijay_Singh</dc:creator>
    <dc:date>2022-07-22T01:14:50Z</dc:date>
    <item>
      <title>Crosstable is duplicating binary fields</title>
      <link>https://community.qlik.com/t5/App-Development/Crosstable-is-duplicating-binary-fields/m-p/1959151#M79062</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;I am doing a simple script where I originally have a table that with one column that identifies the user (ID) and more columns of the type " has_diabities " which are binary fields (0 /1). The user wants to create a filter containing the different options (has_diabities, is_overweight, has_cronic_disease ...etc). My plan was:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create a crosstable&lt;/LI&gt;
&lt;LI&gt;Filter that crosstable to value=1&lt;/LI&gt;
&lt;LI&gt;Be happy&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;However when I do so, the crosstable duplicates de values for each user and each column. Let me explain:&lt;/P&gt;
&lt;P&gt;Record por patient 0 in original table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EugeniaCastilla_0-1658444414568.png" style="width: 813px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/84819iD24FE41AC470147C/image-dimensions/813x39?v=v2" width="813" height="39" role="button" title="EugeniaCastilla_0-1658444414568.png" alt="EugeniaCastilla_0-1658444414568.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;What my cross table is showing for patient 0:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="EugeniaCastilla_1-1658444447065.png" style="width: 700px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/84820iF0376BFB718F1923/image-dimensions/700x495?v=v2" width="700" height="495" role="button" title="EugeniaCastilla_1-1658444447065.png" alt="EugeniaCastilla_1-1658444447065.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;A you can see, Qlik is making a new row for each possible value of the field F.Condition. For example, it didn't do so for the value (HIV) because in the dataset, HIV only has 0 as a value, never a 1. What is happening? x)&lt;/P&gt;
&lt;P&gt;Here is my code:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Orig:&lt;BR /&gt;load DISTINCT&lt;BR /&gt;"" as ID_,&lt;BR /&gt;IF(has_COPD=0, 'No','Yes') AS COPD,&lt;BR /&gt;has_Cardiovascular_disease AS Cardiovascular_disease,&lt;BR /&gt;has_Diabetes AS Diabetes ,&lt;BR /&gt;has_HIV AS HIV,&lt;BR /&gt;has_Liver_dysfunction AS Liver_dysfunction,&lt;BR /&gt;"has_Mild_renal_insufficiency_(ClCr_=_50-90mL/min)" AS Mild_renal_insufficiency,&lt;BR /&gt;"has_Moderate_renal_insufficiency_(ClCr_=30-49_mL/min)" AS Moderate_renal_insufficiency,&lt;BR /&gt;has_None as None,&lt;BR /&gt;has_Other as Other,&lt;BR /&gt;"has_Parkinson's_disease" as Parkinson,&lt;BR /&gt;"has_Severe_renal_insufficiency_(ClCr_=_&amp;lt;30_mL/min)" as Severe_renal_insufficiency&lt;BR /&gt;FROM conn.xlsx&lt;BR /&gt;(txt, codepage is 28591, embedded labels, delimiter is ',', msq) WHERE ""&amp;gt;=0 AND ""&amp;lt;=3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;AUX1: Crosstable (Condition, [Has it]) &lt;BR /&gt;Load Distinct &lt;BR /&gt;ID_,&lt;BR /&gt;COPD,&lt;BR /&gt;Cardiovascular_disease,&lt;BR /&gt;Diabetes ,&lt;BR /&gt;HIV,&lt;BR /&gt;Liver_dysfunction,&lt;BR /&gt;Mild_renal_insufficiency,&lt;BR /&gt;Moderate_renal_insufficiency,&lt;BR /&gt;None,&lt;BR /&gt;Other,&lt;BR /&gt;Parkinson,&lt;BR /&gt;Severe_renal_insufficiency&lt;BR /&gt;resident Orig&lt;BR /&gt;;&lt;/P&gt;
&lt;P&gt;qualify *;&lt;BR /&gt;F:&lt;BR /&gt;load * resident AUX1&lt;BR /&gt;//WHERE [Has it] = 1&lt;BR /&gt;;&lt;BR /&gt;Unqualify *;&lt;BR /&gt;DROP TABLE AUX1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jul 2022 23:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Crosstable-is-duplicating-binary-fields/m-p/1959151#M79062</guid>
      <dc:creator>EugeniaCastilla</dc:creator>
      <dc:date>2022-07-21T23:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Crosstable is duplicating binary fields</title>
      <link>https://community.qlik.com/t5/App-Development/Crosstable-is-duplicating-binary-fields/m-p/1959171#M79064</link>
      <description>&lt;P&gt;Looks like you got some more qualifying columns in your table,&amp;nbsp; along with that it may be making sense to have both 0 and 1 value for one condition. Check out the third parameter in the crosstable function, you may like to have that. Otherwise its not making sense to me having patient 0 both yes and no for a single condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/work-with-cross-tables.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense/June2020/Subsystems/Hub/Content/Sense_Hub/LoadData/work-with-cross-tables.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 01:14:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Crosstable-is-duplicating-binary-fields/m-p/1959171#M79064</guid>
      <dc:creator>Digvijay_Singh</dc:creator>
      <dc:date>2022-07-22T01:14:50Z</dc:date>
    </item>
  </channel>
</rss>

