Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Find Max date of the year based other 2 fields(Name & Design)

Hi All,

Herewith i have attached the QVW file which is developed using QV10 Personal Edition.

As there can be more than one Appraisal per year and Design(Trainer, Junior & Senior Teacher and Head Master), we only want to one Appraisal per year and this should be the lasted Appraisal per year.

Actual One                         :               Desired One

    

3.JPG1.JPG

The script level solution should be most useful.

Thanks ....

Be Blessed with Happiness!!!

Ragards

Gangadharan Moorthy

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi,

this will restrict your data like desired. 

Master:

LOAD Record_No,

     Name,

     DOJ,

     [Appraisal Date],

     Salary,

     Design,

     Login_ID

FROM

FindMaxDate.xls

(biff, embedded labels, table is Sheet1$);

Filtered:

right join (Master) LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date]

resident Master group by Name, Design, year([Appraisal Date]);

If you want to keep all data of all dates in your data model, you could use a left join and create a flag to indicate the dates you are interested in:

Filtered:

left join (Master) LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date], '1' as flag

resident Master group by Name, Design, year([Appraisal Date]);

Hope this helps,

Stefan

View solution in original post

10 Replies
swuehl
MVP
MVP

Hi,

this will restrict your data like desired. 

Master:

LOAD Record_No,

     Name,

     DOJ,

     [Appraisal Date],

     Salary,

     Design,

     Login_ID

FROM

FindMaxDate.xls

(biff, embedded labels, table is Sheet1$);

Filtered:

right join (Master) LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date]

resident Master group by Name, Design, year([Appraisal Date]);

If you want to keep all data of all dates in your data model, you could use a left join and create a flag to indicate the dates you are interested in:

Filtered:

left join (Master) LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date], '1' as flag

resident Master group by Name, Design, year([Appraisal Date]);

Hope this helps,

Stefan

Not applicable
Author

Thanks a lot....

If the script is like this, its working good.

Filtered:

LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date], '1' as flag

resident Master group by Name, Design, year([Appraisal Date]);

Drop table Master;

But the below scripts throughs some Error like: "Execution of script failed. Reload old script."

Filtered:

left join (Master) LOAD Name, Design, Date(max([Appraisal Date])) as [Appraisal Date], '1' as flag

resident Master group by Name, Design, year([Appraisal Date]);

Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

swuehl
MVP
MVP

Hi,

the exact script worked at my place. Could you send your updated app again and I will have a look. If you leave out the left join, you should get a syn Key Table, do you?

Stefan

Not applicable
Author

Ich werde ab 05.09.2011 nicht im Büro sein. Ich kehre zurück am

23.09.2011.

Ich werde Ihre Nachrichten nach meiner Rückkehr beantworten.

Diese E-Mail kann Betriebs- oder Geschäftsgeheimnisse oder sonstige vertrauliche Informationen enthalten. Sollten Sie diese E-Mail irrtümlich erhalten haben, ist Ihnen eine Verwertung des Inhalts, eine Vervielfältigung oder Weitergabe der E-Mail ausdrücklich untersagt.

Bitte benachrichtigen Sie uns und vernichten Sie die empfangene E-Mail. Vielen Dank!

Not applicable
Author

Hi Stefan,

Can you please tell me how to forward modified one to you? Bcz here i can't upload.

Thanks

Gangadharan

swuehl
MVP
MVP

Hi Gangadharan,

there is an upload option in advanced editor (go to edit / answer, "use advanced editor" on the top right ).

Stefan

Not applicable
Author

Thanks Stepan,

I have uploaded the modified qvw.

Hopefully waiting for your reply on this.

by

Gangadharan