Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

Based on conditon load qvd file(field is in TimeStamp Format)

Hi,

- Before going to my content can you please see my qvw file. I've a 3 fields in my qvd one of the field is CaptureDateTime.

- You can see two text objects in sheet i want to retrive the data of captureDateTime between the data of text object.

The CaptureDateTime is in timestamp format. While loading the qvw file i want to retrive the data based on condtion for qvd file i.e between those dates only.

- I stored those data in variable.

For your reference i'm attaching qvd file also.


1 Solution

Accepted Solutions
Not applicable

Hi, try this to filter

WHERE

        CaptureDateTime >= Date#('$(vStartDate)' & ' ' & '$(vStartTime)', 'MM-DD-YYYY hh:mm:ss')

AND CaptureDateTime <= Date#('$(vEndDate)' & ' ' & '$(vEndTime)', 'MM-DD-YYYY hh:mm:ss');

View solution in original post

8 Replies
Not applicable

Hi, try this to filter

WHERE

        CaptureDateTime >= Date#('$(vStartDate)' & ' ' & '$(vStartTime)', 'MM-DD-YYYY hh:mm:ss')

AND CaptureDateTime <= Date#('$(vEndDate)' & ' ' & '$(vEndTime)', 'MM-DD-YYYY hh:mm:ss');

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Thanks a lot Edurdo..

- If i want to retrive last 30 days. If the below code is correct. or not.

Where CaptureDateTime > AddMonths('$(vMaxCaptureDateTime)',-1);

The  variable vMaxCaptureDateTime holds the DateTimeStamp of highest date of qvd file.

Not applicable

Hi, this filter works too

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Eduardo,

Thanks a lot for your help. But few months contains 31 days also at that time the above filter works exactly or not. B'coz i want to retrive exactly last 30 days data only. Sorry to ask you without testing on this b'coz right now i don't have qlikview s/w to test. I'm on leave today.....

Bye Buddy.................

Not applicable

Hi, if just 30 days you can do this:

Where CaptureDateTime > DATE('$(vMaxCaptureDateTime)' - 30, 'DD/MM/YYYY') ;

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Edurado,

Actually this is best filter to apply. I'll try with this filter when i start my work..

Thanks a lot once again.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

Hi Eduardo,

I need small help from you again. I'm storing all captureDateTime field data of in one variable(i.e vTotalDates=07-01-2011,07-02-2011,07-03-2011,07-05-2011,07-06-2011,07-07-2011,07-08-2011,07-09-2011,07-10-2011). While loading the qvd file i'm writing where condition like this.

where Match(CaptureDateTime,'$(vTotalDates)');

But it is not working .....Can you help me in this plz

Not applicable

Hi

I think that you want to simulate a SQL Function " IN ".

Try this:

WHERE IF('$(vTotalDates)' LIKE '*' & DATE(CaptureDateTime, 'MM-DD-YYYY hh:mm:ss') &'*', 1, 0)