Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
magdalenatudose
Creator
Creator

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

Magdalena
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

try with:

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

View solution in original post

6 Replies
agigliotti
Partner - Champion
Partner - Champion

use set analysis like below:

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

magdalenatudose
Creator
Creator
Author

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

Magdalena
agigliotti
Partner - Champion
Partner - Champion

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

magdalenatudose
Creator
Creator
Author

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

Magdalena
agigliotti
Partner - Champion
Partner - Champion

try with:

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

magdalenatudose
Creator
Creator
Author

Thank you Andrea!! Magdalena

Magdalena