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

Date Restriction is not Working Properly

Hi All,

I have a requirement to show last 5 days data in Line Chart.

I have used the below expression:

=Sum({$<M_DATE={">=$(=(Date(Date#('$(vDATE)','M/D/YYYY') - 5)))","<=$(=(Date(Date#('$(vDATE)','M/D/YYYY') - 0)))"}>} ORD_LINE_CNT)

But it is not restricting. Showing all day's data.

Could you please help me on this.

Thanks ,

Sarif

7 Replies
vishsaggi
Champion III
Champion III

What is your date formats of M_DATE and your variable vDate?

may be try this?

=Sum({$<M_DATE={"$(= '>='& Date($(vDATE),'M/D/YYYY') - 5)  & '<=' & Date(Max($(vDATE)),'M/D/YYYY'))"} >} ORD_LINE_CNT)

mostwanted123
Creator
Creator

Try this,

Sum({<M_DATE={">=$(=max($(vDate)-5))<=$(=max($(vDate)))"}>}ORD_LINE_CNT)

Regards,

Pratik

Clever_Anjos
Employee
Employee

Put you expression into an expression of a straight table with no header

mouse over the expression so you can see how your expression is beeing evaluated

mhmmd_srf
Creator II
Creator II
Author

This is not working.

sunny_talwar

Try this

=Sum({$<M_DATE={">=$(=Date(Max(M_DATE) - 5, 'M/D/YYYY'))<=$(=Date(Max(M_DATE), 'M/D/YYYY'))"}>} ORD_LINE_CNT)

vishsaggi
Champion III
Champion III

Can you share your sample app to look into?

Anonymous
Not applicable

Hi Mohammad,

I have deleted the other thread that was a duplicate of this one, and have restored this thread to an un-answered question.

In the future, if you accidentally post a question twice, you can delete one of them by following the steps listed here: Qlik Community Tip: How to Delete a Post

Best regards,

Qlik Community Team