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: 
qlikviewforum
Creator II
Creator II

How to pick only these QVD's from the list of QVD's?

Hi,

I have list of following  QVD's, where I need to fetch first 2 QVD's for the Max(Month/Year) and for rest of the Month/Year I need to fetch only the first QVD. QVD's which need to be picked is highlighted in RED.

Any thoughts on this please!

S2.JPG

Thanks,

qvforum

1 Solution

Accepted Solutions
fosuzuki
Partner - Specialist III
Partner - Specialist III

Check the sample qvw.

Hope this helps you

Fernando

View solution in original post

7 Replies
fosuzuki
Partner - Specialist III
Partner - Specialist III

Check the sample qvw.

Hope this helps you

Fernando

qlikviewforum
Creator II
Creator II
Author

Hi Fernando

Thank you so much for your help. It works perfectly!

Now I am trying to do something like below:

Let vPeriod = 3; //Based on this value I want to put a flag as PICK for latest 3 months and rest of month as drop as drop

Data:

LOAD QVD,

     date(date#(SubField(QVD,'.', 2), 'YYYY_MM_DD')) AS Date,

     date(monthstart(date#(SubField(QVD,'.', 2), 'YYYY_MM_DD'))) AS MonthYear

FROM

C:\Users\fernando.suzuki\Downloads\Data.xls

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

Left Join

LOAD date(max(MonthYear)) AS MaxMonthYear

Resident Data;

Left Join

LOAD QVD,

     MonthYear,

     if(Peek('MonthYear') <> MonthYear, PICK, if(MaxMonthYear = MonthYear and Peek('MonthYear', -2) <> MonthYear, PICK, DROP)) AS Flag

// I want the above condition to be applied only for the latest 3 Months(Value based on vPeriod).(i,e) QVDNAME_2012_11_28 to QVDNAME_2012_09_05.

So that means I want to put a Flag as PICK or DROP using above condition only for latest 3 months. Flag for rest of the records will be DROP.

(i,e) QVDNAME_2012_08_29 to QVDNAME_2012_08_13.

Resident Data

Order By Date DESC;

Result should be exactly like below:

qv.jpg

Thanks,

qvforum

MayilVahanan

HI

PFA

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
qlikviewforum
Creator II
Creator II
Author

Thanks! It works fine. My requirement got changed something above. It would be great if you can help me out on that.

MayilVahanan

HI

Can you mention the requirement, qlikview helpers definitely helps you.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
qlikviewforum
Creator II
Creator II
Author

Hi Ramasamy

May I know what exactly you mean by "qlikview helpers definitely helps you."

By the way I have edited my needs in the above post. You can have a loot at it! By the way you can delete your post as it is not the one which I am looking for now.

Regards,

qvforum

MayilVahanan

Hi

Please find attached file.

qlikview helpers means -> qlikview community members.

I didn't delete any post and even modify it. Can't get you

"! By the way you can delete your post as it is not the one which I am looking for now."

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.