<?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 if Statement Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537564#M556737</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi i have the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what my mission is to do &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;provide dynamic date selection via variable Från Datum and Till Datum, if there is no Date provided there then take &lt;/P&gt;&lt;P&gt;the Default selection (i.e Year 2013, month 6 osv)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have test with hardcoding just a single year, however this seems to overide my first if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(%DatXX&amp;gt;=([Från Datum]) and %DatXX&amp;lt;=([Till Datum]) ,sum([Förs pris] * [Förs-kurs] * [Ursprungligt antal]),&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year ={2013}&amp;gt;}[Förs pris] * [Förs-kurs] * [Ursprungligt antal] ))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help please...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jul 2013 15:45:35 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-07-03T15:45:35Z</dc:date>
    <item>
      <title>if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537564#M556737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi i have the following statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what my mission is to do &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;provide dynamic date selection via variable Från Datum and Till Datum, if there is no Date provided there then take &lt;/P&gt;&lt;P&gt;the Default selection (i.e Year 2013, month 6 osv)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have test with hardcoding just a single year, however this seems to overide my first if statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(%DatXX&amp;gt;=([Från Datum]) and %DatXX&amp;lt;=([Till Datum]) ,sum([Förs pris] * [Förs-kurs] * [Ursprungligt antal]),&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year ={2013}&amp;gt;}[Förs pris] * [Förs-kurs] * [Ursprungligt antal] ))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help please...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 15:45:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537564#M556737</guid>
      <dc:creator />
      <dc:date>2013-07-03T15:45:35Z</dc:date>
    </item>
    <item>
      <title>Re: if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537565#M556738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not easy to answer without knowing how all your fields are related in your data model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Assuming [Från Datum] and [Till Datum] are variables and not fields, maybe like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if( isnum( [Från Datum]) and isnum([Till Datum]) ,&lt;/P&gt;&lt;P&gt;sum({&amp;lt;%DatXX = {"&amp;gt;=$([Fran Datum])&amp;lt;=$([Till Datum])"}&amp;gt;} [Förs pris] * [Förs-kurs] * [Ursprungligt antal]),&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year ={2013}&amp;gt;}[Förs pris] * [Förs-kurs] * [Ursprungligt antal] )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to double check that the format of your two dates matches the format of your %DatXX field.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 16:32:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537565#M556738</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-03T16:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537566#M556739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Swuehl!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply Unfortunately that did not help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have attached the application now to the the message so that you can get a better look.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your help is much appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Bradley&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 17:31:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537566#M556739</guid>
      <dc:creator />
      <dc:date>2013-07-03T17:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537567#M556740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just need to correct for my incorrect spelling of your start date in the set expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=if(isnum("Från Datum") and isnum("Till Datum"),&lt;/P&gt;&lt;P&gt;sum({&amp;lt;%DatXX = {"&amp;gt;=&lt;STRONG&gt;$(Från Datum)&lt;/STRONG&gt;&amp;lt;=$(Till Datum)"}&amp;gt;} [Förs pris] * [Förs-kurs] * [Ursprungligt antal]),&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;Year = {2013}&amp;gt;}[Förs pris] * [Förs-kurs] * [Ursprungligt antal] ))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 18:19:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537567#M556740</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-03T18:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537568#M556741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just a short note , if i would like to pick up the Current Selection (Year,Month,Day as example ) in the Set Analysis statement instead of '2013', how would one do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Brad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 18:48:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537568#M556741</guid>
      <dc:creator />
      <dc:date>2013-07-03T18:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: if Statement Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537569#M556742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To let QV consider your selections for the sum() in the ELSE branch of the if() statement, just remove the set expression completely, considering the selection is standard behaviour!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I think you should ignore all calendar fields in the first sum's set expression:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if(isnum("Från Datum") and isnum("Till Datum"),&lt;/P&gt;&lt;P&gt;sum({&amp;lt;%DatXX = {"&amp;gt;=$(Från Datum)&amp;lt;=$(Till Datum)"},&lt;STRONG&gt; Year, Quarter,Month,Day &lt;/STRONG&gt;&amp;gt;} [Förs pris] * [Förs-kurs] * [Ursprungligt antal]),&lt;/P&gt;&lt;P&gt;sum([Förs pris] * [Förs-kurs] * [Ursprungligt antal] ))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jul 2013 19:01:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/if-Statement-Set-Analysis/m-p/537569#M556742</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2013-07-03T19:01:59Z</dc:date>
    </item>
  </channel>
</rss>

