<?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 How to use Khi 2 test dynamically ? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-use-Khi-2-test-dynamically/m-p/980629#M961579</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with khi 2 test on QlikView :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -I would like to compare two selections, in each selection, we have a number of consumers N1 for first selection, N2 for the second one.&amp;nbsp; &lt;SPAN lang="en"&gt;among them&lt;/SPAN&gt; there is a number of best customers (n1 fo the first selection and n2 for the second one). I would like to know if selection 1 is significatively better than selection 2, if it contains more best customers&amp;nbsp; (what i mean by selection is when you select different options in the qlikview project, for exemple : age, sex...)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -I &lt;/SPAN&gt;thought&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt; about using the khi 2 test. The &lt;/SPAN&gt;&lt;SPAN style="line-height: 19.5px;"&gt;problem&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; is that the &lt;/SPAN&gt;&lt;SPAN style="line-height: 19.5px;"&gt;syntaxe of this test require a table : &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-weight: bold; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;chi2test_p (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-style: italic; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;col, row, observed_value [, expected_value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-weight: bold; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; T&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;he first idea i had is to write 'col ' and 'row' like a list :&amp;nbsp; chi2test_p( ('selection1', 'selecion2'), ('BestCustomers',' AllCustomers'),(n1,N1),(n2,N2))&amp;nbsp; but it doesn't work. n1, n2, N1,N2 are dynamics, they changed when we changed selection1 and selection2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;The second idea that i had is to create a dynamique table so i write it like that :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;Table:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 12pt; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: blue;"&gt;Inline&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: maroon;"&gt;[&lt;BR /&gt;Gender, Coin,&amp;nbsp;&amp;nbsp; Observed, Expected&lt;BR /&gt;selection1, BestCustomers,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n1, n2&lt;BR /&gt;selection2, AllCustomers,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N1,&amp;nbsp; N2&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where n1=sum(BestCutomers) for selection 1. but it doesn't work either because when i reload the script, it doesn't take into account the current selection or the saved selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my explications are clear. Please help me to find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2015 18:57:43 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-10-14T18:57:43Z</dc:date>
    <item>
      <title>How to use Khi 2 test dynamically ?</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-use-Khi-2-test-dynamically/m-p/980629#M961579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem with khi 2 test on QlikView :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -I would like to compare two selections, in each selection, we have a number of consumers N1 for first selection, N2 for the second one.&amp;nbsp; &lt;SPAN lang="en"&gt;among them&lt;/SPAN&gt; there is a number of best customers (n1 fo the first selection and n2 for the second one). I would like to know if selection 1 is significatively better than selection 2, if it contains more best customers&amp;nbsp; (what i mean by selection is when you select different options in the qlikview project, for exemple : age, sex...)&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -I &lt;/SPAN&gt;thought&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt; about using the khi 2 test. The &lt;/SPAN&gt;&lt;SPAN style="line-height: 19.5px;"&gt;problem&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em;"&gt; is that the &lt;/SPAN&gt;&lt;SPAN style="line-height: 19.5px;"&gt;syntaxe of this test require a table : &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV class="column"&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-weight: bold; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;chi2test_p (&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-style: italic; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;col, row, observed_value [, expected_value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 11.000000pt; font-family: 'CourierNewPS'; font-weight: bold; background-color: rgb(82.745000%, 82.745000%, 82.745000%);"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; T&lt;/SPAN&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;he first idea i had is to write 'col ' and 'row' like a list :&amp;nbsp; chi2test_p( ('selection1', 'selecion2'), ('BestCustomers',' AllCustomers'),(n1,N1),(n2,N2))&amp;nbsp; but it doesn't work. n1, n2, N1,N2 are dynamics, they changed when we changed selection1 and selection2.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;The second idea that i had is to create a dynamique table so i write it like that :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;Table:&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: blue; font-size: 12pt; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;LOAD&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;*&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: blue;"&gt;Inline&lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: maroon;"&gt;[&lt;BR /&gt;Gender, Coin,&amp;nbsp;&amp;nbsp; Observed, Expected&lt;BR /&gt;selection1, BestCustomers,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; n1, n2&lt;BR /&gt;selection2, AllCustomers,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; N1,&amp;nbsp; N2&lt;BR /&gt;]&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-size: 12pt; font-family: 'Courier New'; color: black;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;where n1=sum(BestCutomers) for selection 1. but it doesn't work either because when i reload the script, it doesn't take into account the current selection or the saved selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope my explications are clear. Please help me to find a solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2015 18:57:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-use-Khi-2-test-dynamically/m-p/980629#M961579</guid>
      <dc:creator />
      <dc:date>2015-10-14T18:57:43Z</dc:date>
    </item>
  </channel>
</rss>

