Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
joshrussin
Creator III
Creator III

How to retrieve Yesterday's info using an expression in a text box?

Hey everyone, 

I am trying to get yesterday's data from my database and the text box stays empty. I can hard code the date and it works fine, but I need this to be automated and having some trouble using the Today()-1 function.

Sum({$<Date_Dash={(Date('Today() -1')},Program_Dash={'Mechanical Inspection'},Status_Dash={'Completed'}>} Processed_Dash)

I have also tried creating a variable in Main and using it in the 'Date(Today()-1)' place as well, no results.

Thanks!

19 Replies
joshrussin
Creator III
Creator III
Author

How do I share?

vishsaggi
Champion III
Champion III

When you click on reply you can see Use Advanced Editor on right top of the reply window. Once you click on it you can use the attach link and share.

Capture.PNGCapture.PNG

joshrussin
Creator III
Creator III
Author

jmvilaplanap
Specialist
Specialist

Today() function has parameters, maybe is something happening about this.

0 Date at script run

1 Date at function call

2 Date when the document was opened

Default timer_mode is 2. The timer_mode = 1 should be used with caution, since it polls the operating system every second and hence could slow down the system.

How does function Today() work? | Qlik Community

vishsaggi
Champion III
Champion III

Sorry did not get your what is this link again?

sunny_talwar

May be this

=Sum({$<Program_Dash={'Loaners'}, Status_Dash={'WIP'}, Date_Dash = {"$(=Date(Max(Date_Dash)-1))"}>} Processed_Dash)

Capture.PNG

joshrussin
Creator III
Creator III
Author

That is most certainly helping! But I tried in my database and am getting a result, but it is not correct. Here is what I am getting with this line. The result I am getting is 1476.



=Sum({$<Program_Dash={'Loaners'}, Status_Dash={'WIP'}, Date_Dash = {"$(=Date(Max(Date_Dash)-1))"}>} Processed_Dash)


jr_data_1.PNG

sunny_talwar

Seems like you might have duplicate row... may be this

=Avg({$<Program_Dash={'Loaners'}, Status_Dash={'WIP'}, Date_Dash = {"$(=Date(Max(Date_Dash)-1))"}>} Processed_Dash)

joshrussin
Creator III
Creator III
Author

You were correct, I had the data also being loaded into Main. I took that out and it is now correct! Thank you for your help!

sunny_talwar

Awesome