<?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: Nested if Statement to create Sub-Fields from my Date Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852460#M658850</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if d is the date field add a calculated dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()-15), dual('&amp;lt;15',-15),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()-8), dual('&amp;lt;8',-8),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;today(), dual('&amp;lt;0',0),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()+8), dual('&amp;lt;-8',8),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()+15), dual('&amp;lt;-15',15),&lt;/P&gt;&lt;P&gt;dual('other',100)&lt;/P&gt;&lt;P&gt;)))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 20:17:47 GMT</pubDate>
    <dc:creator>maxgro</dc:creator>
    <dc:date>2015-04-16T20:17:47Z</dc:date>
    <item>
      <title>Nested if Statement to create Sub-Fields from my Date Field</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852459#M658849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;I'm a bit stuck on a small problem I have and any suggestions would be much appreciated......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a Date field&amp;nbsp; 'Invoice_Date' being used as a dimension in a bar chart.&lt;/P&gt;&lt;P&gt;I would like to group these invoices into 6 catagories Based on their due date, ie. whether the invoice is due at some point in the future or at some point in the past. These catagories would be relative to today 'today()'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The categories would be as follows:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Invoice due in 15 days +&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px; line-height: 1.5em;"&gt;Invoice due in 8-14 days&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Invoice due in 0-7 days&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Invoice overdue 1-7 days&lt;/P&gt;&lt;P&gt;Invoice overdue 8-14 days&lt;/P&gt;&lt;P&gt;Invoice overdue 15 days +&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I gather I need a calculated dimension made of a chain of 'if' statements but cant quite get it to work.&lt;/P&gt;&lt;P&gt;Any suggestions much appreciated&amp;nbsp;&amp;nbsp; : )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 19:42:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852459#M658849</guid>
      <dc:creator />
      <dc:date>2015-04-16T19:42:54Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if Statement to create Sub-Fields from my Date Field</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852460#M658850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if d is the date field add a calculated dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()-15), dual('&amp;lt;15',-15),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()-8), dual('&amp;lt;8',-8),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;today(), dual('&amp;lt;0',0),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()+8), dual('&amp;lt;-8',8),&lt;/P&gt;&lt;P&gt;if(d&amp;lt;(today()+15), dual('&amp;lt;-15',15),&lt;/P&gt;&lt;P&gt;dual('other',100)&lt;/P&gt;&lt;P&gt;)))))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 20:17:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852460#M658850</guid>
      <dc:creator>maxgro</dc:creator>
      <dc:date>2015-04-16T20:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Nested if Statement to create Sub-Fields from my Date Field</title>
      <link>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852461#M658851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Use Class function with a width of 10 days is this is ok &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;make this as calculated dimension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Code"&gt;class( Today(0) - invoiceDate ,7 )&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and your expression&lt;/P&gt;&lt;P&gt;should be the count or sum of invoices&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Count(Invoices)&amp;nbsp;&amp;nbsp; or sum(invoices)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Class Function will return a data like this &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 229px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl63" height="17" width="131"&gt;=Class(Today(0)-InvoiceDate,10)&lt;/TD&gt;&lt;TD class="xl63" style="border-left: none;" width="98"&gt;count(Value)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl64" height="17" style="border-top: none;"&gt; &lt;/TD&gt;&lt;TD align="right" class="xl65" style="border-top: none;"&gt;93&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;160 &amp;lt;= x &amp;lt; 170&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;170 &amp;lt;= x &amp;lt; 180&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;180 &amp;lt;= x &amp;lt; 190&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;190 &amp;lt;= x &amp;lt; 200&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;530 &amp;lt;= x &amp;lt; 540&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;540 &amp;lt;= x &amp;lt; 550&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;550 &amp;lt;= x &amp;lt; 560&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;560 &amp;lt;= x &amp;lt; 570&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;890 &amp;lt;= x &amp;lt; 900&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;900 &amp;lt;= x &amp;lt; 910&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;910 &amp;lt;= x &amp;lt; 920&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;10&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="17" style="border-top: none;"&gt;920 &amp;lt;= x &amp;lt; 930&lt;/TD&gt;&lt;TD align="right" class="xl67" style="border-top: none; border-left: none;"&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in order to make it look better use the replace function to eleiminate &amp;lt;= and &amp;lt; to - &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Use replace() function for replacing '&amp;lt;= x &amp;lt;' to -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Replace(Class(Today(0)-Date,10),'&amp;lt;= x &amp;lt;','-')&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 20:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Nested-if-Statement-to-create-Sub-Fields-from-my-Date-Field/m-p/852461#M658851</guid>
      <dc:creator>ziadm</dc:creator>
      <dc:date>2015-04-16T20:46:16Z</dc:date>
    </item>
  </channel>
</rss>

