Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to select last 8 weeks default as dimension

Hi ,

I have week field it contains weeks till 35 (like 1,2,....35),but now i am displaying week as dimension and sum(sales) as measure.

i want restrict only for last 8 weeks always.How can i define in bar chart .

Thanks,

Kanna

2 Replies
Anil_Babu_Samineni

Try this?

Sum({<Week = {">=$(=Max(Week-8)) <=$(=Max(Week))"}>} Sales)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
vinieme12
Champion III
Champion III

Create a numeric Week field if you don't have already and use the numeric value to restrict last 8 weeks in set expression


=Sum({<Week = {">=$(=Max(Week)-8)"}>} Sales)


or


=Sum({<Week = {">=$(=Max(TOTAL Week)-8)"}>} Sales)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.