<?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: Syntax question, regarding how to use a variable inside set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790616#M1026513</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gudmundur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define your v_LastWeek_Filter variable like:&lt;/P&gt;&lt;P&gt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month,fYear=&lt;/P&gt;&lt;P&gt;(removing the {$&amp;lt; from start and the &amp;gt;} from the end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can use:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;$(v_LastWeek_Filter),[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not tested, the expression dialog will mark some errors but it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Mar 2015 12:38:01 GMT</pubDate>
    <dc:creator>rubenmarin</dc:creator>
    <dc:date>2015-03-12T12:38:01Z</dc:date>
    <item>
      <title>Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790612#M1026509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I'm new to Qlikview and have a syntax question, regarding how to use a variable inside set analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to use two filters for worked hours, they work separately but not when combined.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;sum( $(v_LastWeek_Filter) Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But when I combine them it does not work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;DateKey={$(v_LastWeek_Filter)},[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried different things like putting an equal sign and commas here and there but without luck, can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 10:45:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790612#M1026509</guid>
      <dc:creator />
      <dc:date>2015-03-12T10:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790613#M1026510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guðmundur,&lt;/P&gt;&lt;P&gt;It all comes to first how the variable has been SET or LET and second, what the variable actually contains.&lt;/P&gt;&lt;P&gt;If $(v_LastWeek_Filter) equals to 7, a numeric value that matches DateKey, then the syntax is correct.&lt;/P&gt;&lt;P&gt;But my guess is that this variable has a date representation (DD/MM/YYYY) or something similar, therefore you need single quotes to match properly:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Sum({$&amp;lt;DateKey={'$(v_LastWeek_Filter)'},[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Again, it will depend on how are values stored into DateKey and how are they n v_LastWeek_Filter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Miguel&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 11:18:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790613#M1026510</guid>
      <dc:creator>Miguel_Angel_Baeyens</dc:creator>
      <dc:date>2015-03-12T11:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790614#M1026511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please go through this attachment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;AS&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 11:19:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790614#M1026511</guid>
      <dc:creator>amit_saini</dc:creator>
      <dc:date>2015-03-12T11:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790615#M1026512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and thank you for your answer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all variables are created using LET, and DateKey is a date representation (DD/MM/YYYY). Tried the single quotes but that does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what the other variables look like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_LastWeek_Filter:&lt;/P&gt;&lt;P&gt;{$&amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month,fYear=&amp;gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_StartOfLastWeek:&lt;/P&gt;&lt;P&gt;=WeekStart( Date( v_StartOfWeek- 1))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_StartOfWeek:&lt;/P&gt;&lt;P&gt;=WeekStart(v_MaxDate)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v_EndOfLastWeek:&lt;/P&gt;&lt;P&gt; =WeekEnd(v_StartOfLastWeek)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 12:27:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790615#M1026512</guid>
      <dc:creator />
      <dc:date>2015-03-12T12:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790616#M1026513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi gudmundur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can define your v_LastWeek_Filter variable like:&lt;/P&gt;&lt;P&gt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month,fYear=&lt;/P&gt;&lt;P&gt;(removing the {$&amp;lt; from start and the &amp;gt;} from the end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then you can use:&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;$(v_LastWeek_Filter),[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not tested, the expression dialog will mark some errors but it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 12:38:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790616#M1026513</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2015-03-12T12:38:01Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790617#M1026514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Always a good technique is to replace $-substitution variables at the highest level with what they actually contain. For example, an expression like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;sum({$&amp;lt;DateKey={$(v_LastWeek_Filter)},[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&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; font-size: 13px; line-height: 1.5em;"&gt;where v_LastWeek_Filter contains:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;{$&amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month,fYear=&amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;produces an initital text substitution result of:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;sum({$&amp;lt;DateKey=&lt;SPAN style="color: #ff6600;"&gt;&lt;STRONG&gt;{&lt;SPAN style="font-size: 13px;"&gt;{$&amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"}, Year=,Week=,Day=,Month,fYear=&amp;gt;}&lt;/SPAN&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;,[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5em; color: #3d3d3d; font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Apparently the problem is that you seem to be nested set analysis... I think QlikView doesn't support nested set analysis except using P() and E() functions.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 12:42:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790617#M1026514</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-12T12:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790618#M1026515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A possible solution:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put a list of set modifiers in v_LastWeek_filter instead of a complete set spec:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month,fYear=&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewrite your expression so that it includes these set modifiers in an existing set spec, like in:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'courier new', courier; font-size: 13px;"&gt;sum({$&amp;lt;&lt;EM&gt;$(v_LastWeek_Filter)&lt;/EM&gt;,[Store Name]-={'Name1','Name2'}&amp;gt;} Worked_Hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The small version that will still work then becomes something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-size: 13px; font-family: 'courier new', courier;"&gt;sum({$&amp;lt;&lt;EM&gt;$(v_LastWeek_Filter)&lt;/EM&gt;&amp;gt;} Worked_Hours)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Mar 2015 12:48:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790618#M1026515</guid>
      <dc:creator>Peter_Cammaert</dc:creator>
      <dc:date>2015-03-12T12:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax question, regarding how to use a variable inside set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790619#M1026516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Peter,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;got this to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({$&amp;lt;DateKey={"$(='&amp;gt;=' &amp;amp; '$(v_StartOfLastWeek)' &amp;amp; '&amp;lt;=' &amp;amp; '$(v_EndOfLastWeek)')"},Year=,Week=,Day=,Month=,fYear=,[Store Name]-={"Name1","Name2"}&amp;gt;}Worked_Hours)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Mar 2015 16:28:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Syntax-question-regarding-how-to-use-a-variable-inside-set/m-p/790619#M1026516</guid>
      <dc:creator />
      <dc:date>2015-03-13T16:28:12Z</dc:date>
    </item>
  </channel>
</rss>

