Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
BrianDH
Creator II
Creator II

Date Filter (Today)

Team

I need to add a date filter to my sheet.  I'd like it to default to "TODAY" with the option to change. 

My user only wants to see today's data when the app opens.   With an option to remove or change.

 

Thanks for the help

B

Labels (1)
2 Solutions

Accepted Solutions
Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi Brian

Using the following in the filter pane (or finding the field in your Selections tool) and then bookmarking it and setting it as your default bookmark should work:

=Floor(<Your Date Field>)=Floor(Today())

I guess it will be the following if your date field is [ENTERED DTTM]:

=Floor([ENTERED DTTM])=Floor(Today())

Hope this helps 🙂

Regards,

Mauritz

View solution in original post

zied_ahmed1
Specialist
Specialist

Hello,

You can create a new filed like this in the script :

Today() as Today1

 

And after that create a default bookmarks in selecting it 

 

Thanks 

View solution in original post

10 Replies
JustinDallas
Specialist III
Specialist III

Do you have a master calendar? Or does your fact table have a datefield?  If it does, you can create another field called [In Today].

LOAD *,

If( InToday(SomeDate), 'Y','N' ) AS 'InToday'

...

You do this by doing the following steps:

 

-Duplicate App to your work folder.

-Modify the script so that there is a field that restricts to today

-Reload Script

-Select "InToday"='Y' in the app

-Create a bookmark

-Right click bookmark and click the "Set selections as app default"

-Republish the app

 

Here is what I am talking about with respect to the bookmark

Bkmark1.png

 

 

Let me know if this helps.

BrianDH
Creator II
Creator II
Author

Master Calendar?

Yes it ha a date field (v_entered_dttm)

JustinDallas
Specialist III
Specialist III

Then use the "v_entered_dttm" field to create your flag field "Is In Today" Y/N.

BrianDH
Creator II
Creator II
Author

I added: 

,If(InToday(PS_VOUCHER.ENTERED_DTTM), 'Y','N' ) AS 'InToday'

Into my LOAD SQL Script.  I get an error 

Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi there Brian

While adding a flag is always nice and I am sure it will work, you can also type a formula in the selections bar which equates to today's date and save it as your default bookmark. This 4 minute video explains it very nicely.

Regards,

Mauritz

BrianDH
Creator II
Creator II
Author

I added a filter pane.  I am using (Entered dttm) as my dimension (=Date(floor(V_ENTERED_DTTM),'yyyy-MM-dd'))  Now I see all the dates. 

How do I get it to default to todays date?

 

Thanks

Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi Brian

I'm not close to Qlik right now, but you should able to type:

=Date(Today(),'YYYY-MM-DD')

That's assuming your date field is also in a YYYY-MM-DD format. If you want to you can post your app and I can help you tomorrow morning.

Regards,

Mauritz

BrianDH
Creator II
Creator II
Author

This is what I have now (filter Pain populated by date field) "=Date(floor(V_ENTERED_DTTM),'yyyy-MM-dd') "

I want it to default to the most recent date which should be Today/Now when moved to production

How can I push it to Today()Filter Pane with datesFilter Pane with dates

Mauritz_SA
Partner - Specialist
Partner - Specialist

Hi Brian

Using the following in the filter pane (or finding the field in your Selections tool) and then bookmarking it and setting it as your default bookmark should work:

=Floor(<Your Date Field>)=Floor(Today())

I guess it will be the following if your date field is [ENTERED DTTM]:

=Floor([ENTERED DTTM])=Floor(Today())

Hope this helps 🙂

Regards,

Mauritz