Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_chilvers
Specialist
Specialist

Finding a max (or min) value in a loaded table


I feel there should be an elegant way to find a maximum value for a field in a table which has been loaded in a script. For example, if I am loading sales of products, can I find the last date something was sold? I do not wish to use PEEK in case the loaded data is not in date order.

Any ideas ?

What I am trying to achieve is an incremental load, based on date.

Thanks in advance.

Richard

1 Solution

Accepted Solutions
jagannalla
Partner
Partner

Hi,

Main:

Load * from MainData;

Load Max(Date) as MaxDate Resident Main;

Let vMax=peek('MaxDate',-1,'Main');

Thanks,

Jagan

View solution in original post

6 Replies
sujeetsingh
Master III
Master III

jagannalla
Partner
Partner

Hi,

Main:

Load * from MainData;

Load Max(Date) as MaxDate Resident Main;

Let vMax=peek('MaxDate',-1,'Main');

Thanks,

Jagan

View solution in original post

richard_chilvers
Specialist
Specialist
Author

Yes - that is elegant. Thank you!

Richard

paul_w_routledg
Creator II
Creator II

If your Resident data set is large MAX or MIN functions can take a while to resolve.

Here's a useful post on how to optimise this.

Extracting Min(Date) and Max(Date) from large QVD

richard_chilvers
Specialist
Specialist
Author

Thanks guys.

Sorry to have repeated a question from previous posts, but I didn't pick up earlier answers in my search.

Richard

richard_chilvers
Specialist
Specialist
Author

Thanks. Its a good post from Steve and he has helped me several times with my queries