<?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: class function padded with zeros in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527661#M599696</link>
    <description>You could use the alt function to alternate with the value you need, so once it has no value on the field you want, you'd get the 0, something like that:&lt;BR /&gt;&lt;BR /&gt;Alt(class(kwh,1),0) as kWh_Interval_temp,&lt;BR /&gt;&lt;BR /&gt;Something like that,&lt;BR /&gt;The alt() gets the first value that appears and is not null.&lt;BR /&gt;&lt;BR /&gt;Hope it helps,&lt;BR /&gt;&lt;BR /&gt;Felipe.</description>
    <pubDate>Tue, 08 Jan 2019 11:43:37 GMT</pubDate>
    <dc:creator>felipedl</dc:creator>
    <dc:date>2019-01-08T11:43:37Z</dc:date>
    <item>
      <title>class function padded with zeros</title>
      <link>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527618#M599695</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;I am trying to generate Probability Distributions from&amp;nbsp; many years worth of data.&lt;/P&gt;&lt;P&gt;I can use the class function to split the data into buckets:&lt;/P&gt;&lt;P&gt;eg:&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;table1:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;LOAD&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt; * &lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;INLINE&lt;/FONT&gt; &lt;FONT color="#800000" size="1"&gt;[&lt;BR /&gt;ID2,kwh&lt;BR /&gt;1,2&lt;BR /&gt;1,3.2&lt;BR /&gt;1,1&lt;BR /&gt;1,99&lt;BR /&gt;1,3.2&lt;BR /&gt;1,34]&lt;/FONT&gt;&lt;FONT size="1"&gt;;&lt;BR /&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;[PDF Table template]&lt;/FONT&gt;&lt;FONT size="1"&gt;:&lt;BR /&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#0000ff" size="1"&gt;LOAD&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;[ID2]&lt;/FONT&gt;&lt;FONT size="1"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#008000" size="1"&gt;// MonthName($(vMonth_and_Year)) AS PDF_Date_temp,&lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;class&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;kwh&lt;/FONT&gt;&lt;FONT size="1"&gt;,1) &lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;AS&lt;/FONT&gt; &lt;FONT color="#800000" size="1"&gt;kWh_Interval_temp&lt;/FONT&gt;&lt;FONT size="1"&gt;,&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;count&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;kwh&lt;/FONT&gt;&lt;FONT size="1"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;AS&lt;/FONT&gt; &lt;FONT color="#800000" size="1"&gt;NumberofkWh&lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;RESIDENT&lt;/FONT&gt;&lt;FONT size="1"&gt; table1 &lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;GROUP&lt;/FONT&gt; &lt;FONT color="#0000ff" size="1"&gt;BY&lt;/FONT&gt; &lt;FONT color="#800000" size="1"&gt;[ID2]&lt;/FONT&gt;&lt;FONT size="1"&gt;, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="1"&gt;class&lt;/FONT&gt;&lt;FONT size="1"&gt;(&lt;/FONT&gt;&lt;FONT color="#800000" size="1"&gt;kwh&lt;/FONT&gt;&lt;FONT size="1"&gt;,1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Qlikview&amp;nbsp;will be&amp;nbsp;efficient and will generate the class interval (or bucket) only where I have data.&amp;nbsp;I&amp;nbsp;don't want that.&lt;/P&gt;&lt;P&gt;I want it to give me all the class intervals, and&amp;nbsp;&amp;nbsp;if there is no data then put a zero in, so it gets padded with zeros.&lt;/P&gt;&lt;P&gt;is it possible to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 11:01:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527618#M599695</guid>
      <dc:creator>eddie666</dc:creator>
      <dc:date>2019-01-08T11:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: class function padded with zeros</title>
      <link>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527661#M599696</link>
      <description>You could use the alt function to alternate with the value you need, so once it has no value on the field you want, you'd get the 0, something like that:&lt;BR /&gt;&lt;BR /&gt;Alt(class(kwh,1),0) as kWh_Interval_temp,&lt;BR /&gt;&lt;BR /&gt;Something like that,&lt;BR /&gt;The alt() gets the first value that appears and is not null.&lt;BR /&gt;&lt;BR /&gt;Hope it helps,&lt;BR /&gt;&lt;BR /&gt;Felipe.</description>
      <pubDate>Tue, 08 Jan 2019 11:43:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527661#M599696</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2019-01-08T11:43:37Z</dc:date>
    </item>
    <item>
      <title>Re: class function padded with zeros</title>
      <link>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527695#M599697</link>
      <description>&lt;P&gt;You will have to generate the missing kwh to be able to do this.... try something like this&lt;/P&gt;&lt;PRE&gt;table1:
LOAD * INLINE [
    ID2, kwh
    1, 2
    1, 3.2
    1, 1
    1, 99
    1, 3.2
    1, 34
];

Concatenate(table1)
LOAD ID2,
	 Min + IterNo() - 1 as kwh,
	 1 as Flag
While Min + IterNo() - 1 &amp;lt;= Max;
LOAD ID2,
	 Min(kwh) as Min,
	 Max(kwh) as Max
Resident table1
Group By ID2;

[PDF Table template]:
LOAD [ID2],
	 Class(kwh,1) as kWh_Interval_temp,
	 Count(If(Flag &amp;lt;&amp;gt; 1, kwh)) as NumberofkWh
Resident table1
Group By [ID2], Class(kwh,1);

DROP Table table1;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Jan 2019 12:24:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527695#M599697</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-08T12:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: class function padded with zeros</title>
      <link>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527714#M599698</link>
      <description>&lt;P&gt;hey, thank you.&lt;/P&gt;&lt;P&gt;I couldn't get ALT to work, but generating extra values for kwh has worked.&lt;/P&gt;&lt;P&gt;Actually I think your script with the Flag setting has helped with another problem I have had. Thank you for the advice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fingers crossed.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jan 2019 12:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/class-function-padded-with-zeros/m-p/1527714#M599698</guid>
      <dc:creator>eddie666</dc:creator>
      <dc:date>2019-01-08T12:48:07Z</dc:date>
    </item>
  </channel>
</rss>

