Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Not able to restrict 31 days data

Hello experts,

I am  new to Qlik view and

I am trying to restrict data for last 31 days data from max date. Actually date field is time stamp and converted that into date by floor function and used it in expression like below.

=Count({<[DateOnly]={">=$(=Date(Max([DateOnly])-30))<=$(=Date(Max([DateOnly])))"} >} DISTINCT [Visitor ID])

But it is giving complete data and not able to restrict 31 days data.

Regards,

Nanda

26 Replies
sasiparupudi1
Master III
Master III

put

Max(DateOnly)

and

Date(Max([DateOnly])-30)


into a textbox and see what they are returning


hth

Sasi

Not applicable
Author

it is returning 12/31/2020

and 12/1/2020

Regards,

Nanda

sasiparupudi1
Master III
Master III

there is your problem.. you can not just minus 30 from the date without considering the month and year changes

I suggest you use

addmonths(Max(DateOnly),-1)

instead of Max(DateOnly)-30


hth

Sasi

Not applicable
Author

Can you look into this screen shot.

sasiparupudi1
Master III
Master III

Sorry, I misread the date format.. try

=Count({<[DateOnly]={">=$(=Date(Max([DateOnly])-30, 'M/D/YYYY'))<=$(=Date(Max([DateOnly]), 'M/D/YYYY'))"} >} DISTINCT [Visitor ID])


Not applicable
Author

No Use sasidhar.

Regards,

Nanda

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Nanda,

The only option is you export a sample data from your application and try to replicate the same issue in sample file and share with us.

Without which it will be difficult to understand your issue.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!