<?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 Use variable in expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590660#M1098629</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two variables defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = Week(Today());&lt;/P&gt;&lt;P&gt;LET vLastWeek = vCurrentWeek-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have an expression to calculate revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Book={"EM EUROBONDS VOL MATCH"}&amp;gt;}IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I calculate revenue for last week by using my vLastWeek variable and adapting my expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Apr 2014 10:28:40 GMT</pubDate>
    <dc:creator />
    <dc:date>2014-04-17T10:28:40Z</dc:date>
    <item>
      <title>Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590660#M1098629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two variables defined&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vCurrentWeek = Week(Today());&lt;/P&gt;&lt;P&gt;LET vLastWeek = vCurrentWeek-1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I have an expression to calculate revenue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;Book={"EM EUROBONDS VOL MATCH"}&amp;gt;}IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I calculate revenue for last week by using my vLastWeek variable and adapting my expression?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:28:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590660#M1098629</guid>
      <dc:creator />
      <dc:date>2014-04-17T10:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590661#M1098630</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: 12.800000190734863px;"&gt;=sum({$&amp;lt;Book={"EM EUROBONDS VOL MATCH"}, Week = {"$(=&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px;"&gt;vLastWeek &lt;/SPAN&gt;)"}&amp;gt;}IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:32:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590661#M1098630</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-17T10:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590662#M1098631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have a field called Week&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how is that defined?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:34:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590662#M1098631</guid>
      <dc:creator />
      <dc:date>2014-04-17T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590663#M1098632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Write below in script below your DateField&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Week(YourDateField) as Week &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:35:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590663#M1098632</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-17T10:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590664#M1098633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't have access to the load script. I'm am doing a binary load from another qvw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:41:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590664#M1098633</guid>
      <dc:creator />
      <dc:date>2014-04-17T10:41:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590665#M1098634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can try write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Add this script to the expression &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Week(YourDateFieldHere) = {'$(=Week(Today() )-7&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #3d3d3d; font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt; &lt;/STRONG&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;)'&lt;/STRONG&gt;&lt;/SPAN&gt;&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;"&gt;=Sum({$&amp;lt;Book={"EM EUROBONDS VOL MATCH"}, Week(YourDateFieldHere) = {'$(=Week(Today() )-7&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)'}&amp;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;"&gt;&amp;nbsp; IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:45:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590665#M1098634</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-17T10:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590666#M1098635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I get a blank result when I do that Anand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:49:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590666#M1098635</guid>
      <dc:creator />
      <dc:date>2014-04-17T10:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590667#M1098636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does my date field need to be in a certain format for that to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my list boxes it appears as DD-MMM-YYYY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 10:58:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590667#M1098636</guid>
      <dc:creator />
      <dc:date>2014-04-17T10:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590668#M1098637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try like&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;"&gt;=sum({$&amp;lt;Book={"EM EUROBONDS VOL MATCH"}, Week(YourDateFieldHere) = {"$(=Week(Today( ))-7&lt;/SPAN&gt;&lt;SPAN style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;)"}&amp;gt;}IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:02:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590668#M1098637</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-17T11:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590669#M1098638</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It didn't work either. Blank result again&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible my CalendarDate field may not be in the correct format, even though it displays correctly in the list box and tables? Would that make a difference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590669#M1098638</guid>
      <dc:creator />
      <dc:date>2014-04-17T11:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590670#M1098639</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes try to convert or may be add week field in the script load.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:33:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590670#M1098639</guid>
      <dc:creator>its_anandrjs</dc:creator>
      <dc:date>2014-04-17T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590671#M1098640</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you dont have&lt;/P&gt;&lt;P&gt;1) week field or&lt;/P&gt;&lt;P&gt;2) access to script... &lt;/P&gt;&lt;P&gt;you need to use date field...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=SUM({$&amp;lt;Book={'EM EUROBONDS VOL MATCH'},CalendarDate = {'&amp;gt;=$(=WeekStart(Today()-7))&amp;lt;=$(=WeekEnd(Today()-7))'}&amp;gt;}IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:40:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590671#M1098640</guid>
      <dc:creator>MK_QSL</dc:creator>
      <dc:date>2014-04-17T11:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Use variable in expression</title>
      <link>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590672#M1098641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take =max(your_date_field) in text-box .Check your Date format Ex. dd-mm-yyyy ...whatever format it shows simply assign that format using date function like date(&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;Week(Today( ))-7&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;)&lt;/SPAN&gt;,'Your date format') in expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If your field is in text format then you should change text to date by like this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; date(num(date#(your_date_field,'existing date format write here')),'DD-MM-YYYY')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;"&gt;=Sum({$&amp;lt;Book={'EM EUROBONDS VOL MATCH'},&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;"&gt; Week(date(num(date#(your_date_field,'existing date format write here')),'DD-MM-YYYY')) = {'$(=Week(Today() )-7&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;)'}&amp;gt;}&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;"&gt;&amp;nbsp; IF(PURCHASE_SALE='P',-NOMINAL,NOMINAL)*PRICE/100)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; regards,&lt;/P&gt;&lt;P&gt;Harshal &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Apr 2014 11:46:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Use-variable-in-expression/m-p/590672#M1098641</guid>
      <dc:creator />
      <dc:date>2014-04-17T11:46:51Z</dc:date>
    </item>
  </channel>
</rss>

