Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Highlighted
samvile18
Contributor II

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

Working with max date

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

6 Replies

Working with max date

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

Partner
Partner

Working with max date

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
Contributor II

Working with max date

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

Working with max date

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

Working with max date

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

Partner
Partner

Working with max date

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