<?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: Problem with Load Script and using field I have created.. with nested if statement in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730453#M10581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks .. that worked .. i did have the logic in the if() wrong and chose to just use the if function twice .. as follows.&amp;nbsp; It does feel a little strange that a field created can not be re-used later in the script - thats a big learning point for me !&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( date("Last Email Received") &amp;gt; date("Last Email Sent"), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (date("Last Email Received") &amp;gt; date("Last Activity"), date("Last Email Received") , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Activity") &amp;gt; date("Last Email Sent"), date("Last Activity") ,date("Last Email Sent") ))) as activity_date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(now() - &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( date("Last Email Received") &amp;gt; date("Last Email Sent"), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (date("Last Email Received") &amp;gt; date("Last Activity"), date("Last Email Received") , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Activity") &amp;gt; date("Last Email Sent"), date("Last Activity") ,date("Last Email Sent") ))) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'d') as days_since_activity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Ian &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Sep 2014 11:35:52 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-09-19T11:35:52Z</dc:date>
    <item>
      <title>Problem with Load Script and using field I have created.. with nested if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730450#M10578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I am new to QlikSense and loving it .. however I have come to a bit of a roadblock with the following &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( date("Last Email Received") &amp;lt; date("Last Email Sent"), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Email Received") &amp;lt;&amp;nbsp; date("Last Activity"),&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Activity"), date("Last Email Sent")), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Email Received")) as activity_date, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(now() - activity_date,'d') as days_since_activity,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year(activity_date) as activity_date_year,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; month(activity_date) as activity_date_month,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 3 dates and my intention is to put the most recent date of the 3 in a field called activity_date then work out the number of days from now to that date.&amp;nbsp;&amp;nbsp; I think the syntax of the embedded if statements is correct, all the braces match up ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I load the script, I get a "&lt;SPAN style="color: #595959; font-family: 'Courier New'; font-size: 15px; background-color: rgba(255, 38, 38, 0.2);"&gt;Field not found - &amp;lt;activity_date&amp;gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 12:34:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730450#M10578</guid>
      <dc:creator />
      <dc:date>2014-09-18T12:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Load Script and using field I have created.. with nested if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730451#M10579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Ian,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Split the Load, activity_date doesn't exist until the first load, use someting like:&lt;/P&gt;&lt;P&gt;LOAD *,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(now() - activity_date,'d') as days_since_activity,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year(activity_date) as activity_date_year,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; month(activity_date) as activity_date_month;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;LOAD &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: 'andale mono', times;"&gt;if( date("Last Email Received") &amp;lt; date("Last Email Sent"), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Email Received") &amp;lt;&amp;nbsp; date("Last Activity"),&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Activity"), date("Last Email Sent")), &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Email Received")) as activity_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'andale mono', times; font-size: 10pt;"&gt;...&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 12:37:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730451#M10579</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2014-09-18T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Load Script and using field I have created.. with nested if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730452#M10580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't use any field name which you have renamed in the same table...&lt;/P&gt;&lt;P&gt;In your case, you have to use as below&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Load *,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 10pt; font-style: inherit; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(now() - activity_date,'d') as days_since_activity,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="font-size: 10pt; font-style: inherit; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; year(activity_date) as activity_date_year,&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; month(activity_date) as activity_date_month;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp; if( date("Last Email Received") &amp;lt; date("Last Email Sent"),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Email Received") &amp;lt;&amp;nbsp; date("Last Activity"), &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Activity"), date("Last Email Sent")),&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date("Last Email Received")) as activity_date&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: 'andale mono', times;"&gt;From TableName;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Sep 2014 12:43:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730452#M10580</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-09-18T12:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Load Script and using field I have created.. with nested if statement</title>
      <link>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730453#M10581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks .. that worked .. i did have the logic in the if() wrong and chose to just use the if function twice .. as follows.&amp;nbsp; It does feel a little strange that a field created can not be re-used later in the script - thats a big learning point for me !&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what worked:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( date("Last Email Received") &amp;gt; date("Last Email Sent"), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (date("Last Email Received") &amp;gt; date("Last Activity"), date("Last Email Received") , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Activity") &amp;gt; date("Last Email Sent"), date("Last Activity") ,date("Last Email Sent") ))) as activity_date,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Interval(now() - &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ( date("Last Email Received") &amp;gt; date("Last Email Sent"), &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (date("Last Email Received") &amp;gt; date("Last Activity"), date("Last Email Received") , &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(date("Last Activity") &amp;gt; date("Last Email Sent"), date("Last Activity") ,date("Last Email Sent") ))) &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,'d') as days_since_activity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;&lt;P&gt;Ian &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Sep 2014 11:35:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Problem-with-Load-Script-and-using-field-I-have-created-with/m-p/730453#M10581</guid>
      <dc:creator />
      <dc:date>2014-09-19T11:35:52Z</dc:date>
    </item>
  </channel>
</rss>

