<?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 Create a variable based on another variable in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313724#M115801</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;I have a variable vMaxRMDate that creates a date: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=if(max({1&amp;lt; [Mart]={Revenue}&amp;gt;}[Date])=Today(0), max({1&amp;lt;[Mart]={Revenue}&amp;gt;}[Date])-1,max({1&amp;lt;[Mart]={Revenue}&amp;gt;}[Date]))I &lt;/P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then based on this date, i want another variable to calcualte the Work Day associated with the above date so I tried this and nothing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;[Date]={'$(vMaxRMDate)'}&amp;gt;}[Work Day in FQ])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first value is workign and getting me 5/18/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the second variable should give me 13 because the Date 5/18/2011 equates to work day 13 stored in the calendar table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What other formula can I use to do this. I have tried various IF statemsn adn nothing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 May 2011 15:31:08 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-05-19T15:31:08Z</dc:date>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313724#M115801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;I have a variable vMaxRMDate that creates a date: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;=if(max({1&amp;lt; [Mart]={Revenue}&amp;gt;}[Date])=Today(0), max({1&amp;lt;[Mart]={Revenue}&amp;gt;}[Date])-1,max({1&amp;lt;[Mart]={Revenue}&amp;gt;}[Date]))I &lt;/P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then based on this date, i want another variable to calcualte the Work Day associated with the above date so I tried this and nothing:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({&amp;lt;[Date]={'$(vMaxRMDate)'}&amp;gt;}[Work Day in FQ])&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the first value is workign and getting me 5/18/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the second variable should give me 13 because the Date 5/18/2011 equates to work day 13 stored in the calendar table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What other formula can I use to do this. I have tried various IF statemsn adn nothing&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 15:31:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313724#M115801</guid>
      <dc:creator />
      <dc:date>2011-05-19T15:31:08Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313725#M115802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; What is happening if you change the variable to 5/18/2011?&lt;/P&gt;&lt;P&gt;Maybe the ' in the {'$(vMax...)'} statement are too much.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 15:48:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313725#M115802</guid>
      <dc:creator>martinpohl</dc:creator>
      <dc:date>2011-05-19T15:48:07Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313726#M115803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If [Date] is a DateTime, QlikView is really Picky on what he considers a valid selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a listbox with Date Values&lt;/LI&gt;&lt;LI&gt;Open the search box on the listbox&lt;/LI&gt;&lt;LI&gt;Write a valid date until a value is selected&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;You probably will have to input a complete dateTIME, according to the format specified on the first page of the load script.&lt;/P&gt;&lt;P&gt;E.g., something like 5/18/2011 00:00:00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, the variable should be =sum({&amp;lt;[Date]={'$(=Date(vMaxRMDate, 'dd/MM/yyyy hh:mm:sss'))'}&amp;gt;}[Work Day in FQ])&lt;/P&gt;&lt;P&gt;Use the date format you have on your load script.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 16:03:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313726#M115803</guid>
      <dc:creator />
      <dc:date>2011-05-19T16:03:02Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313727#M115804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi Debbie, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried this way: =sum({&amp;lt;[Date]={'&lt;STRONG&gt;=$(vMaxRMDate)&lt;/STRONG&gt;'}&amp;gt;}[Work Day in FQ]) ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Cesar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 20:11:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313727#M115804</guid>
      <dc:creator>cesaraccardi</dc:creator>
      <dc:date>2011-05-19T20:11:01Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313728#M115805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; thank you all, so far nothing has worked.&amp;nbsp; I got closer with Cesar's answer but I got the sum of all days, so i changed to MAX and now I get 66 (maximum days in quarter) instead of 13 which is the specific work date for 5/18/2011&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=max({&amp;lt;[Date]={'=$(vMaxRMDate)'}&amp;gt;}[Work Day in FQ]) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 20:16:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313728#M115805</guid>
      <dc:creator />
      <dc:date>2011-05-19T20:16:14Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313729#M115806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure if I understood what you are trying to do and why.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are able to get vMaxRMDate, and if Date and [Work Day in FQ] are fields in your calendar file, you may try to use the 'lookup' expression for get the desired value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 22:15:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313729#M115806</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-05-19T22:15:43Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313730#M115807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; This is not a feature I have used before.&amp;nbsp; How do I use "lookup"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 22:20:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313730#M115807</guid>
      <dc:creator />
      <dc:date>2011-05-19T22:20:35Z</dc:date>
    </item>
    <item>
      <title>Create a variable based on another variable</title>
      <link>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313731#M115808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A few things you should try (one of them has to work):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Change the single quotes to double quotes: &lt;EM&gt;=sum({&amp;lt;[Date]={"$(vMaxRMDate)"}&amp;gt;}[Work Day in FQ])&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;Add (and not replace) Double quotes, in case qlikvew is interpreting the variable as a literal. &lt;EM&gt;=sum({&amp;lt;[Date]={"'$(vMaxRMDate)'"}&amp;gt;}[Work Day in FQ])&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;The final one, this one will work for sure, but is a little messier. Force qlikview to interpret the literal value in your variable as a Date: &lt;EM&gt;=sum({&amp;lt;[Date]={"$(=Date#('$(vMaxRMDate)', 'MM/DD/YYYY'))"}&amp;gt;}[Work Day in FQ])&lt;/EM&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure to type the correct format in the 3rd option. Also, make sure your default date format matches the one that the [Date] field is using, otherwise, specify the format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you go for the 3rd option, it would be a good idea to check what the expression is returning, using a Text Object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps.&lt;/P&gt;&lt;P&gt;Mike.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 May 2011 22:34:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Create-a-variable-based-on-another-variable/m-p/313731#M115808</guid>
      <dc:creator>mike_garcia</dc:creator>
      <dc:date>2011-05-19T22:34:42Z</dc:date>
    </item>
  </channel>
</rss>

