<?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: to write expression using variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141079#M752985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you change compday and show the same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Oct 2018 12:19:30 GMT</pubDate>
    <dc:creator>Anil_Babu_Samineni</dc:creator>
    <dc:date>2018-10-29T12:19:30Z</dc:date>
    <item>
      <title>to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141070#M752976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Hi &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I have a variable named daysOfComparison declared as follows:-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;=&lt;SPAN style="color: #0000ff;"&gt;date&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;lastDate&lt;/SPAN&gt;)-&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;compday &lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;where compday is the value entered by user for comparing no. of days. &lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080;"&gt;Lets say if user enters 5 as comparison no. of days input box&amp;nbsp; then the sales for 10/5/2018 will be displayed in chart as per formula mentioned above in variable &lt;/EM&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Note last date is 10/10/2018&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Following is the image for above explanation &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216933_PAINT2.png" style="height: auto;" /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;Now I want to write an expression for the same ie when user selects comparison(no. of days )=5 then sales for 10/5/2018 should be displayed &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;How to write an expression?&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141070#M752976</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141071#M752977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to show only one date of value, Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sum({&amp;lt;lastDate = {$(=VariableName)}&amp;gt;} Measure) // VariableName means - Your Input box variable&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Or&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px;"&gt;Sum({&amp;lt;lastDate = {"=$(=Date(date(lastDate) - $(compday)))"}&amp;gt;} Measure)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 05:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141071#M752977</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T05:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141072#M752978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;lastDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; = {&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 12pt;"&gt;$(=DaysOfComp)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)&amp;nbsp; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;This expression is giving no result &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;lastDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;"=$(=Date(date(lastDate) - $(compday)))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt;"&gt;This expression is giving result but when I am entering value as comparison no. of days as 5 the corresponding date in text is being changed as 10/5/2018&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt;"&gt;but the result is not reflected in charts &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt;"&gt;Following is the image &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style=": ; font-size: 12pt;"&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216934_PAINT2.png" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 06:10:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141072#M752978</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T06:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141073#M752979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="j-simple-name font-color-normal"&gt; Please help @Sunny Talwar&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 07:27:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141073#M752979</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T07:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141074#M752980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure that you have created variable for comparison purpose?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #000000;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;lastDate&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;"=$(=Date(date(lastDate) - $(&lt;SPAN style="color: #ff0000;"&gt;compday&lt;/SPAN&gt;)))"&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;[inv value]&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;)&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt; font-style: inherit; font-family: inherit; font-weight: inherit;"&gt;&lt;STRONG style=": ; color: #ff0000; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;compday - &lt;SPAN style="color: #000000;"&gt;Can you please check if The variable is same. And Can you show the same variable in Text object after entering some value whether it is changing or not?&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 08:55:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141074#M752980</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T08:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141075#M752981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have varaiable name DateOfComp labelled as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LastDate - No. Of Days &lt;/P&gt;&lt;P&gt; in which I have entered the value as follows :-&lt;/P&gt;&lt;P&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216940_PAINT2.png" style="width: 620px; height: 349px;" /&gt;&lt;/P&gt;&lt;P&gt;and comp is again a variable which has user defined value and it is used in the formula used for DateOfComp&lt;/P&gt;&lt;P&gt;and when expression is taken as an text box object the value is not changing for the following expression &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG&gt;Sum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; color: #000000;"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;({&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;lastDate&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt; = {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;"=$(=Date(date(lastDate) - $(&lt;/STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;compday&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG&gt;)))"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;}&amp;gt;} &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;[inv value]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;but when I enter compday=8 the corresponding value gets changed for the DateOfComp labelled as LastDate - No. Of Days &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 09:23:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141075#M752981</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T09:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141076#M752982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you test alone in text object using below and tell me what is returning?&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;=Date(date(lastDate) - $(&lt;/STRONG&gt;&lt;SPAN style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;compday&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="font-size: 13.3333px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;))&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:06:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141076#M752982</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T10:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141077#M752983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Following I am getting in text box&lt;/P&gt;&lt;P&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/216959_PAINT2.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 10:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141077#M752983</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T10:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141078#M752984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Why this particular expression is giving an error?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(=&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 12pt;"&gt;$(DaysOfComp)&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt;)}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 12:18:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141078#M752984</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T12:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141079#M752985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you change compday and show the same?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 12:19:30 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141079#M752985</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T12:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141080#M752986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if I am entering compday as 7 then I am getting value as 10/7/2017&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 12:32:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141080#M752986</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T12:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141081#M752987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here both the expression are giving me same values&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;"=$(=Date(date(Sold_Date)))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)&lt;BR /&gt; &lt;BR /&gt;and &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;Sold_Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; = {&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;"=$(=Date(date(Sold_Date) - $(compday)))"&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;) &lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;why?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 12:34:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141081#M752987</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T12:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141082#M752988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13px; 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: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;Sum&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #000000;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;({&amp;lt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;sold_Date&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt; = {&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;"=$(=Date(Max(&lt;STRONG style="color: #000000; font-family: inherit; font-size: 13.3333px; font-style: inherit;"&gt;sold_Date&lt;/STRONG&gt;) - $(&lt;/STRONG&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit; color: #ff0000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;compday&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;)))"&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;}&amp;gt;} &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;[inv value]&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit; color: #000000;"&gt;&lt;STRONG style="font-style: inherit; font-size: 13.3333px; font-family: inherit;"&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 12:58:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141082#M752988</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-29T12:58:18Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141083#M752989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want the variable which I am using here below in the image ie DaysOfcomp&amp;nbsp; should be used in expression&lt;/P&gt;&lt;P&gt;so my expression will be this? This below expression is giving an error, Please help me in correcting this. Rest is done &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Sum&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;({&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;lastDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt; = {=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 12pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 12pt;"&gt;DaysOfComp&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 12pt;"&gt;)}&amp;gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 12pt;"&gt;[inv value]&lt;/SPAN&gt;&lt;SPAN style="font-size: 12pt;"&gt;)&lt;BR /&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2018 15:24:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141083#M752989</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-29T15:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141084#M752990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said that DaysofComp is number which comes thru input box, And you are using Date format for that. Qlik can't identify as DD or MM or YYYY. Not really sure what you mean to first message and Different than&amp;nbsp; Last Message. BTW, You expression Wrong - Check the set analysis rules here &lt;A href="https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/" title="https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/"&gt;https://www.analyticsvidhya.com/blog/2014/01/set-analysis-qlikview/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And More over, You need to convert input box to Date then my suggestion would be this - &lt;A href="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/makedate.htm" title="https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/makedate.htm"&gt;https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFunctions/makedate.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If None of them are not working - We may ask input and output result which you want to see Here are the some tips&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/docs/DOC-16454"&gt;Uploading a Sample&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2018 02:36:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141084#M752990</guid>
      <dc:creator>Anil_Babu_Samineni</dc:creator>
      <dc:date>2018-10-30T02:36:40Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141085#M752991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DaysOfComp is not a number. It is in date format&lt;/P&gt;&lt;P&gt;value of DaysOfComp is calculated in following formula&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;=(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;lastDate&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)-&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;compday &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;and when DaysOfcomp is taken as a text&amp;nbsp; box its value is shoen below &lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM style=": ; color: #808080; font-size: 8pt;"&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/217041_PAINT2.png" style="height: auto;" /&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2018 04:36:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141085#M752991</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-30T04:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: to write expression using variable</title>
      <link>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141086#M752992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I am not able to see 'use advanced editor option' to upload application &lt;/P&gt;&lt;P&gt;&lt;IMG alt="PAINT2.png" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/217050_PAINT2.png" style="height: 274px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Oct 2018 06:48:19 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/to-write-expression-using-variable/m-p/141086#M752992</guid>
      <dc:creator>sakshikaul</dc:creator>
      <dc:date>2018-10-30T06:48:19Z</dc:date>
    </item>
  </channel>
</rss>

