6 Replies Latest reply: Aug 21, 2017 8:38 AM by Magdalena Tudose

# How can i see only the last 4 weeks in chart_in Qlik Sense

Hi, I have a chart with the dimension: week number and some measures for each week. I want to see in chart, only the values for the last 4 weeks inclusive the week i select in filter. How can I do that? Thank you, Magdalena

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

use set analysis like below:

ex. sum( {< Week = {">\$(=Max(Week) - 4)"} >} Sales )

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

Hi Andrea,

Thank you, but is not working.

My dimension is: week

My measure is: only({<[week]=>}[value1])

and when I make measure how you said: only( {< Week = {">(Week - 4)"} >} [value1] ) the chart is null.

Thank you,

Magdalena

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

only( {< Week = {">\$(=Max(Week) - 4)"} >} [value1] )

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

Hi, You are right! I was writing wrong! It is ok, but only when I am selecting this week it appears the last 4 weeks, but when I select other weeks appear all the previos weeks, inclusiv the current week. How can I modiffics the measure to appear just 4 weeks, indifferent what week i select? Thank you, Magdalena

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

try with:

only( {< Week = {">\$(=Max(Week) - 4)<=\$(=Max(Week))"} >} [value1] )

• ###### Re: How can i see only the last 4 weeks in chart_in Qlik Sense

Thank you Andrea!! Magdalena