Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
beskqlik
Contributor II
Contributor II

Show count of order for last 30 days

Hi 

i am trying to get count of orders for last 30 days. When  using belwo expression, i am getting zero.DATA_DATE , formatting is also taken care of the expression.

Count({$<DATA_DATE={">=$(=Date(max(DATA_DATE)-30, 'DD-MMM-YY'))"}>}order)

 

1 Solution

Accepted Solutions
naveen409
Contributor III
Contributor III

Hi 

1) Create a variable: -

VMax= Date(max(Date_Field)-30,'DD-MM-YYYY')

where you will roll back to a month.

2) Try This:

=Count({$<DATA_Field={"$(=VMax)"}>}order).

But Tell me how is your date format. So That we can help

Thanks 

Naveen

View solution in original post

10 Replies
sunny_talwar

So, does your expression work when you hard-code the value? >=25-Feb-19?

beskqlik
Contributor II
Contributor II
Author

I changed my expression as below and it worked. Thanks for your reply

COUNT({<DATA_DATE={">=$(=DATE(Max(DATA_DATE),'DD-MMM-YY')-30)"}>} Order)

naveen409
Contributor III
Contributor III

Hi 

1) Create a variable: -

VMax= Date(max(Date_Field)-30,'DD-MM-YYYY')

where you will roll back to a month.

2) Try This:

=Count({$<DATA_Field={"$(=VMax)"}>}order).

But Tell me how is your date format. So That we can help

Thanks 

Naveen

beskqlik
Contributor II
Contributor II
Author

THanks, it worked.

My date format is 'DD-MMM-YY'

 

BUt i have one request. By default report is showing 30 days data. But when i select one date at filter, report is bringing only that one dates data, but i need 30 days data previous to the selected date.

naveen409
Contributor III
Contributor III

Try with

GetFieldSelections(),

Thanks and Regards,

Naveen

beskqlik
Contributor II
Contributor II
Author

GetFieldSelections(AVG({<DATA_DATE1={">=$(=DATE(Max(DATA_DATE1),'DD-MMM-YY')-30)"}>} order))

It was giving - data

 

naveen409
Contributor III
Contributor III

You got the solution.

Regards,

Naveen

beskqlik
Contributor II
Contributor II
Author

no, when i am using getfieldselection, i am getting no data as '-'

naveen409
Contributor III
Contributor III

So tell me you have date field as a filter.