<?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: Avoid Multiple If's in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030845#M939789</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;If((Today() - Fdate) &amp;lt; -2562,'&amp;gt;-7 Yrs',&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;If((Today() - Fdate) &amp;gt;&amp;nbsp; 2562, '&amp;gt;7 Yrs', &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Ceil(fabs(Today() - Fdate)/366) * If((Today() - Fdate) &amp;lt; 0, -1, 1) &amp;amp; ' Yrs'))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; as &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;UpdateFdate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I like Stefan's Sign() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;If((Today() - Fdate) &amp;lt; -2562,'&amp;gt;-7 Yrs',&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;If((Today() - Fdate) &amp;gt;&amp;nbsp; 2562, '&amp;gt;7 Yrs', Sign(Today() - Fdate) &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Ceil(fabs(Today() - Fdate)/366)&amp;nbsp; &amp;amp; ' Yrs'))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; as &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;UpdateFdate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Feb 2016 11:49:08 GMT</pubDate>
    <dc:creator>sunny_talwar</dc:creator>
    <dc:date>2016-02-02T11:49:08Z</dc:date>
    <item>
      <title>Avoid Multiple If's</title>
      <link>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030844#M939788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one suggest me how should I avoid multiple if's in my load script. At present my script looks like below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt; -2562,'&amp;gt;-7 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -2196,'-7 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -1830,'-6 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -1464,'-5 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -1098,'-4 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -732,'-3 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= -366,'-2 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;=0,'-1 Yr', &lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 366,'1 Yr',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 732,'2 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 1098,'3 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 1464,'4 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 1830,'5 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 2196,'6 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;lt;= 2562,'7 Yrs',&lt;BR /&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;((&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Today&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;() - &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Fdate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &amp;gt; 2562,'&amp;gt;7 Yrs','&amp;gt;-7 Yrs')))))))))))))))) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;UpdateFdate &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333300; font-size: 10pt;"&gt;&lt;STRONG&gt;How Should I optimize this code.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333300; font-size: 10pt;"&gt;&lt;STRONG&gt;Thannks&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:41:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030844#M939788</guid>
      <dc:creator>soha1902</dc:creator>
      <dc:date>2016-02-02T11:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Multiple If's</title>
      <link>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030845#M939789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;If((Today() - Fdate) &amp;lt; -2562,'&amp;gt;-7 Yrs',&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;If((Today() - Fdate) &amp;gt;&amp;nbsp; 2562, '&amp;gt;7 Yrs', &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Ceil(fabs(Today() - Fdate)/366) * If((Today() - Fdate) &amp;lt; 0, -1, 1) &amp;amp; ' Yrs'))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; as &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;UpdateFdate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;I like Stefan's Sign() function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;Load&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;&lt;BR /&gt;If((Today() - Fdate) &amp;lt; -2562,'&amp;gt;-7 Yrs',&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;STRONG&gt;&lt;SPAN style="font-size: 13.3333px; line-height: 1.5em;"&gt;If((Today() - Fdate) &amp;gt;&amp;nbsp; 2562, '&amp;gt;7 Yrs', Sign(Today() - Fdate) &amp;amp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Ceil(fabs(Today() - Fdate)/366)&amp;nbsp; &amp;amp; ' Yrs'))&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; as &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN style="color: #575757; font-size: 10pt; font-family: arial, helvetica, sans-serif;"&gt;&lt;STRONG&gt;UpdateFdate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:49:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030845#M939789</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-02-02T11:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Avoid Multiple If's</title>
      <link>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030846#M939790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sign(Today() - Fdate) &amp;amp; (div(Today()-Fdate, 366)+1) &amp;amp; 'Yr(s)' as UpdateFdate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;probably needs some enhancements, but could get you started&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 11:49:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Avoid-Multiple-If-s/m-p/1030846#M939790</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-02-02T11:49:19Z</dc:date>
    </item>
  </channel>
</rss>

