Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
samvile18
Creator III
Creator III

Working with max date

Hello all,

I think this is a fairly quick fix as I feel like I'm very close to the answer already but can anyone help with the following: -

I'm trying to force my QVW Document to look at the latest dates worth of data...I've set up a variable called varMaxDate, that holds the maximum date of loaded data. The bit I'm struggling with is setting this to the open command of the document, I basically want the user to be looking at the latest load when they open the file.

Can anyone help?

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try this.

    Go to Settings-> Document Properties -> Triggers -> OnOpen -> Add Actions->Selection -> Selection in field ->

     Give the field name and in search string type

 

     =max(Date)

     Click ok and save the document.

Regards,

Kaushik Solanki

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

View solution in original post

6 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   one thing i want to suggest here is if you dont require the previous day data for any kind of analysis, it is advisable to remove those data and load only the data needed for the analysis.

    The reason is unnecessary data will occupy the space and may also effect in the performance of the application.

     So if you want to just show the latest day data then try to load only that data, something like this.

     load

         field1,

         field2,

         Date

      from

         xyx

      where Date = date(today());

      

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
magavi_framsteg
Partner - Creator III
Partner - Creator III

Hi SamVile.

If you don't need the older data for your analysis, you should better do as the previous speaker suggests.

Otherwise, if you indeed need the data, you could create a trigger for Document.OnOpen with action "Select in Field" with your variable varMaxDate.

Hope this helps.

samvile18
Creator III
Creator III
Author

Hi Chaps,

I do actually need all of the historic data...I just want to show the latest upon open.

I can't get the trigger to actually work...am I missing something?

I've put my variable into the Field section of the trigger event...is that right??

Not applicable

Hi,

On the On Open event you have to choose an action: Select in field.
Set your date in the 'Field' and in serach string either your variable, either =Max(Date)

regards

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

   Try this.

    Go to Settings-> Document Properties -> Triggers -> OnOpen -> Add Actions->Selection -> Selection in field ->

     Give the field name and in search string type

 

     =max(Date)

     Click ok and save the document.

Regards,

Kaushik Solanki

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

Hi ..I want the same,but with few changes.

After the last reload the value should be zero or nothing on the next reload if no data is updated.

It6 should only give the value when new data have been updated in the field.

regards

Kamal