Skip to main content
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
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

This dates still contains the timestamp.

Use the Date(Floor(Date)) function to get only dates.

Regards,

Kaushik Solanki

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

These dates are in 1940s, hope you are purposely dealing with these old dates..

Not applicable
Author

No. ETL team loaded from 1900 to 2020. Is it the issue.

Not applicable
Author

Hi Kaushik,

I have converted into date already by using same script what u suggested and that field only DateOnly using in set analysis. I have given u screen shot as my original Date field is having these type of values.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Nanda,

It would be great if you can share your application.

Regards,

Kaushik Solanki

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

try,

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

Not applicable
Author

No Use. My file size almost 400 MB or else i would have uploaded the file

sasiparupudi1
Master III
Master III

the year on your dateonly filed is showing 1900? is it correct?

Not applicable
Author

Hi,

I am attaching QVW doc and removing all possible values.

Regards,

Nanda

Not applicable
Author

Hi,

Yes, it is correct. ETL people loaded dates from 1900 to 2020 with time stamps.