<?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 Bad ratio calculation due to value omission in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Bad-ratio-calculation-due-to-value-omission/m-p/1222676#M860959</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;ANSWERED HERE:&lt;/STRONG&gt; &lt;A href="https://community.qlik.com/thread/246135" target="_blank"&gt;Create new rows when there are no sales&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am pretty new in the Qlik world and I have a QlikView program, wich gets two datebases from SQL server. The databases are from a car dealer.&lt;/P&gt;&lt;P&gt;The 1º has 3 columns: Cars sold, year and month.&lt;/P&gt;&lt;P&gt;The 2º has 4 columns: price of accessories sold, accessory brand, year and month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So year and month are linked in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem comes when I try to make a ratio of price/cars sold in a bar chart (Expression: sum(PNC)/sum([cars sold]). When a brand hasn't sold any accessory in a month, in the second data base there isn't rows showing that the sales were 0 €, so qlik just ignores the cars that have been sold in that month. But I need to include them for the ratio to work correctly, I need to add 0 accesories sold per 34 cars sold (for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought some solutions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add the rows manually. But there are like 30.000 so it would take me a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To analyse the datebase inside the script editor. If there's not a sale in a month, to create a new row with the accessory brand name. the month, the year and the 0 sale. The problem here is that I don't know how to program in Qlik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there any option in Qlikview that does this atomatically? If not, can someone help me with my second solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
    <dc:creator>sdaniels0606</dc:creator>
    <dc:date>2020-11-25T16:16:04Z</dc:date>
    <item>
      <title>Bad ratio calculation due to value omission</title>
      <link>https://community.qlik.com/t5/QlikView/Bad-ratio-calculation-due-to-value-omission/m-p/1222676#M860959</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;ANSWERED HERE:&lt;/STRONG&gt; &lt;A href="https://community.qlik.com/thread/246135" target="_blank"&gt;Create new rows when there are no sales&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am pretty new in the Qlik world and I have a QlikView program, wich gets two datebases from SQL server. The databases are from a car dealer.&lt;/P&gt;&lt;P&gt;The 1º has 3 columns: Cars sold, year and month.&lt;/P&gt;&lt;P&gt;The 2º has 4 columns: price of accessories sold, accessory brand, year and month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So year and month are linked in QlikView.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem comes when I try to make a ratio of price/cars sold in a bar chart (Expression: sum(PNC)/sum([cars sold]). When a brand hasn't sold any accessory in a month, in the second data base there isn't rows showing that the sales were 0 €, so qlik just ignores the cars that have been sold in that month. But I need to include them for the ratio to work correctly, I need to add 0 accesories sold per 34 cars sold (for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought some solutions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add the rows manually. But there are like 30.000 so it would take me a lot of time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To analyse the datebase inside the script editor. If there's not a sale in a month, to create a new row with the accessory brand name. the month, the year and the 0 sale. The problem here is that I don't know how to program in Qlik.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there any option in Qlikview that does this atomatically? If not, can someone help me with my second solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Bad-ratio-calculation-due-to-value-omission/m-p/1222676#M860959</guid>
      <dc:creator>sdaniels0606</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bad ratio calculation due to value omission</title>
      <link>https://community.qlik.com/t5/QlikView/Bad-ratio-calculation-due-to-value-omission/m-p/1222677#M860960</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This might help you out:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-3786"&gt;Generating Missing Data In QlikView&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jan 2017 12:32:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Bad-ratio-calculation-due-to-value-omission/m-p/1222677#M860960</guid>
      <dc:creator>adamdavi3s</dc:creator>
      <dc:date>2017-01-10T12:32:16Z</dc:date>
    </item>
  </channel>
</rss>

