Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sunny_ryuke
Partner - Contributor II
Partner - Contributor II

Dynamic Bookmark creation on Date field

Date format : DD/MM/YYYY

I need to create a Dynamic Bookmark on date field filter for current day -1. If someone can help please do

I tried the below expressions but no luck

=Num([Date Field]) = Max(Total[Date Field] -1)

 

If I don't subtact 1 I'm getting the max date value with this 

=Num([Date Field]) = Max(Total[Date Field])

 

Labels (1)
8 Replies
Ben_P
Creator II
Creator II

If you're just trying to get the max value within your entire dataset (ignoring all filters), then this should do it:

max({1} [Date Field])-1

or if you need it formatted a certain way, wrap it in date():

date(max({1} [Date Field])-1,'DD/MM/YYYY')

marcus_sommer

Maybe in this way: =Num([Date Field]) = (Max([Date Field]) -1)

sunny_ryuke
Partner - Contributor II
Partner - Contributor II
Author

I have tried these already they didn't work

sunny_ryuke
Partner - Contributor II
Partner - Contributor II
Author

No it didn't work 

Bhushan_Mahajan
Creator II
Creator II

@sunny_ryuke I need filter data based on Date filed using bookmark. so used one filter pane with respective date field and applied below expression in that filter search box and the created bookmark.

=Date(Field,'DD/MM/YYYY')>=Date(Yearstart(today(),0,4),'DD/MM/YYYY')

Ben_P
Creator II
Creator II

I'm not sure why that doesn't work. I've implemented similar many times, and it always works fine. It might be the way you're applying the filter. I think I should have expanded on my original post:

This is how to set the variable:

If you're just trying to get the max value within your entire dataset (ignoring all filters), then this should do it:

max({1} [Date Field])-1

or if you need it formatted a certain way, wrap it in date():

date(max({1} [Date Field])-1,'DD/MM/YYYY')

... and this is how to apply the filter for the bookmark:

1. Create a filter pane containing your date field.

2. Filter your date field on the variable, not on the value... so in the example below, I have vBookmarkTest set as =max({1} WK_COMM)-7 . I then filter my date field (WK_COMM) as below, specifying that the field must equal the value of the variable. Press enter to make the selection (don't click the tick icon).

Ben_P_1-1737966111298.png

3. Create your bookmark.

4. You can then check that this has worked by viewing bookmark details, and you will see that the variable is specified.

Ben_P_2-1737966346696.png

 

 

Bhushan_Mahajan
Creator II
Creator II

@sunny_ryuke I think It will not work since max can be used in Measure and filter works on dimension.

Maybe You can do it in backend and then apply bookmark.

Mandy
Contributor II
Contributor II

Hi try setting up a variable for vMaxDate

 

Let vMaxDate = date(today(), 'DD/MM/YYYY');

The use the autoCalender to get the date from your timestamp.

[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$time','$Date')
FIELDS

Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),

DERIVE FIELDS FROM FIELDS
your_date_time
USING [autoCalendar] ;

Go to your date field and add in the following, it should then show your required date

=your_date_time.autoCalendar.Date=vMaxDate

 

Save your bookmark now.