<?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: Set expression in a Dimension (Date) for a static Bar chart in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544746#M109722</link>
    <description>&lt;P&gt;In addition to the suggestions from&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42840"&gt;@WeLoveQlik&lt;/a&gt;&amp;nbsp;such conditions such be placed within the expressions and not in the dimensions.&lt;/P&gt;&lt;P&gt;Expressions are native aggregations which could be simply extending with set statements. By dimensions it would be needed to use either if-loops for the conditions or to wrap the dimensions with an aggr() construct to apply a set statement - and both ways a rather more complex and coming with disadvantages in regard to the usability and performance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Mar 2026 05:10:43 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2026-03-13T05:10:43Z</dc:date>
    <item>
      <title>Set expression in a Dimension (Date) for a static Bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544717#M109718</link>
      <description>&lt;P&gt;TIA!&lt;/P&gt;
&lt;P&gt;I am trying to use a bar chart to show the sales of the last six weeks for many stores.&amp;nbsp; Left axis would be sales, bottom axis would be stores and bars would be the Monday's for the past six weeks corresponding to when the week's data was loaded.&amp;nbsp; I want the dates to be static in that the user can't change them, but, upon every new week, we see the previous six weeks of data.&lt;/P&gt;
&lt;P&gt;I was trying to use a set expression in the 'bar' dimension, but it kept coming back as 'invalid.'&amp;nbsp; I can determine the previous six Mondays and place them into a string delimited by a character ('/').&amp;nbsp; Or use the date functions and work back six Mondays and use that.&amp;nbsp; Doesn't matter to me.&lt;/P&gt;
&lt;P&gt;The stores would be dynamic based on region drilling down to states, cities, etc.&amp;nbsp; The left axis would represent a few measures.&amp;nbsp; The bars are what I want as static.&lt;/P&gt;
&lt;P&gt;What would be a solution?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 19:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544717#M109718</guid>
      <dc:creator>463</dc:creator>
      <dc:date>2026-03-12T19:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression in a Dimension (Date) for a static Bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544718#M109719</link>
      <description>&lt;P&gt;Hello!&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first thing i would do is create a weekday Field in the script using the WEEKDAY() Function.&lt;/P&gt;&lt;P&gt;Then I would create a Variable that you can use to reference the last 6 weeks.&lt;/P&gt;&lt;P&gt;if you have a Weekindex Field, you could use Max(Week Index)-6 and then use Set analysis&lt;/P&gt;&lt;P&gt;New Variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v6WeeksAgo = Max(WeekIndex)-6&lt;/P&gt;&lt;P&gt;Set Analysis&lt;/P&gt;&lt;P&gt;{&amp;lt; WeekIndex=&amp;nbsp;&lt;SPAN&gt;{"&amp;gt;$(=$(v6WeeksAgo ))"}, WeekDay = {'Mon'} &amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you only have Dates, I would create a variable that is your Max( Date ) - 42 and use that in set analysis.&lt;/P&gt;&lt;P&gt;New Variable&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; v6WeeksAgo = Max(Date)-42&lt;/P&gt;&lt;P&gt;Set Analysis&lt;/P&gt;&lt;P&gt;{&amp;lt; Date =&amp;nbsp;&lt;SPAN&gt;{"&amp;gt;$(=$(v6WeeksAgo))"}, WeekDay = {'Mon'} &amp;gt;}&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Mar 2026 19:22:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544718#M109719</guid>
      <dc:creator>WeLoveQlik</dc:creator>
      <dc:date>2026-03-12T19:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression in a Dimension (Date) for a static Bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544746#M109722</link>
      <description>&lt;P&gt;In addition to the suggestions from&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/42840"&gt;@WeLoveQlik&lt;/a&gt;&amp;nbsp;such conditions such be placed within the expressions and not in the dimensions.&lt;/P&gt;&lt;P&gt;Expressions are native aggregations which could be simply extending with set statements. By dimensions it would be needed to use either if-loops for the conditions or to wrap the dimensions with an aggr() construct to apply a set statement - and both ways a rather more complex and coming with disadvantages in regard to the usability and performance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 05:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544746#M109722</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2026-03-13T05:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Set expression in a Dimension (Date) for a static Bar chart</title>
      <link>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544803#M109737</link>
      <description>&lt;P&gt;Thanks to all.&lt;/P&gt;
&lt;P&gt;It took a little finagling but these post showed me the light.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2026 16:18:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-expression-in-a-Dimension-Date-for-a-static-Bar-chart/m-p/2544803#M109737</guid>
      <dc:creator>463</dc:creator>
      <dc:date>2026-03-13T16:18:01Z</dc:date>
    </item>
  </channel>
</rss>

