Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
SystemError
Contributor II
Contributor II

Show last N days on the graph

Hello everybody! 
on x-axis as a dimension I use:
        =Date(SetDateYear(Date, Year(Today())), 'DD.MM')
for measures I use set analysis - sum()- for current and previous year. 

While switching to sheet I want to see only 25 last days.  I tried doing it via sheet actions -> select values matching search criteria:
Field: Date

Criteria
='>=' & addyears(date(Max({<gross_sales={*}>} Date)-25),-1) &'<='& addyears(Max({<gross_sales={*}>} [Date]), -1)

AND >=' & date(Max({<gross_sales={*}>} Date)-25) &'<='& Max({<gross_sales={*}>} [Date])

However its not working (i can see all days starting from January) with AND condition I could only select last 25 days of this OR previous year.  How to select last 25 days of both years? 
qlik2.jpg

Labels (5)
1 Reply
G3S
Creator III
Creator III

try

If((DATEFIELD<(Today()) and DATEFIELD>(Today())-25),DATEFIELD)