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: 
tvisha
Creator II
Creator II

Sorting Date

Hi,

 

I need to get the top 4 or the max 4 dates. I am using the below in the expression in the chart,

 

=if(year(date([Week Ending]))=year(date(Today())),
if(week(date(Today()))-week(date([Week Ending]))<5,(weekstart([Week Ending])))
)

However it is giving me as, I am not understanding why I am getting those - , I just need the top 5. Sample data attached. 

tvisha_0-1656580964130.png

 

Thank You,

Labels (1)
1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

You just need to uncheck >> include Null Values for this dimension

qlikCommunity1.PNG

 

Also try below expression

 

=Aggr(if([Week Ending]>=Max([Week Ending],5),Weekstart([Week Ending])),[Week Ending])

 

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

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

You just need to uncheck >> include Null Values for this dimension

qlikCommunity1.PNG

 

Also try below expression

 

=Aggr(if([Week Ending]>=Max([Week Ending],5),Weekstart([Week Ending])),[Week Ending])

 

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

Thank you that worked. I thought that, but as the data did not had any null values in the original excel I was not sure. Not sure how null is introduced here.