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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
nareshthavidishetty
Creator III
Creator III

Dynamic default day selection

Hi am having day level filter as below

Untitled.png

here when ever user open the application by default the day filter is should selected yesterday like today is 19th when the user opens the application the day filter should be  18th ( in green) .

Thanks

1 Solution

Accepted Solutions
tamilarasu
Champion
Champion

You can use triggers like below.

Capture.PNG

Edit: Use expression as =Day(Today())-1, since you want to select yesterday date.

View solution in original post

11 Replies
tamilarasu
Champion
Champion

You can use triggers like below.

Capture.PNG

Edit: Use expression as =Day(Today())-1, since you want to select yesterday date.

PrashantSangle

Hi,

It should be

Day(Today()-1) not day(Today())-1

because if Today is 1st day of month then your expression will evaluate 0.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
tamilarasu
Champion
Champion

Thank you. It's my mistake.

jonathandienst
Partner - Champion III
Partner - Champion III

I usually build my apps in a way that does not require an initial selection. So if i have many days in th model, but need a chart/table representing a day, then I would use a set expression to get the most recent date (Max(ReportDate)). if the user selects a date, than the Max(ReportDate) reflects the user's selection.

That way when the user first opens the app, it selects the most recent date (eg yesterday), but the user can select a date or dates from the date selections and it will show the details according to the user's selections.

I define a variable

Set vMaxDate = '=date(Max(ReportDate))';

Then the expression look like:

=Sum({<ReportDate = {'$(vMaxDate)'}>} Amount)

And no initial date selection is required.

I also usually add vMaxDate to the chart/table captions/titles- eg

='Closing balances - ' & vMaxDate

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nareshthavidishetty
Creator III
Creator III
Author

Thanks,but my requirement is when ever we open the application the day should selected as yesterday  and it should be as below 

Untitled.png

tamilarasu
Champion
Champion

Did you try what I suggested.?

nareshthavidishetty
Creator III
Creator III
Author

sorry i tired that it's not working

tamilarasu
Champion
Champion

It's working fine. Check the attachment.

sasikanth
Master
Master

Check the option always one selected values , if you want to hold the selection for that filter

along with the trigger suggested by Nagaraj