Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
absekrafi
Creator III
Creator III

Data extraction between 2 dates

Dear Qlikview community,

I have to extract data from oracle database tables which have date as a field.

I want to extract data between a start date and an end date.

Do you know how to implement that in Qlikview?

Thank you in advance,

7 Replies
YoussefBelloum
Champion
Champion

Hi,

do you mean you want to get the difference between two Date values ?

example:

Date1: 01/01/2018

Date2: 30/01/2018

difference = 29 days

giovanneb
Creator II
Creator II

Hi, try this

Where

date >= '2018/01/01' AND date<= '2018/09/12';

Best Reguards

dplr-rn
Partner - Master III
Partner - Master III

Depends on scenario if you want to select data between 2 dates create slider/calendar objects attached to from and to variables utilize these depending on scenario

1)with triggers to make the master calendar selections

2) or use in set analysis count({<Date={'>=$(vStartDate)<=$(vEndDate)'}>} distinct Customer)

below video is useful

Selecting Arbitrary Date Ranges - YouTube

if as youssef asked difference between 2 date values thats a different scenario

vishsaggi
Champion III
Champion III

may be you want to try like in your SQL Script:

SQL

SELECT yourfieldlist, Field2, Field3, DateField....

FROM yoursourcetable a,

(Select Min(DateField) AS MinDate, Max(DateField) AS MaxDate

FROM yoursourcetable)b

WHERE a.DateField between MinDate and MaxDate;

absekrafi
Creator III
Creator III
Author

Hi Dilip,

Thank you very much I think the second option is the answer to what I want to do.

I will check that on Qlikview and let you know.

Best regards

absekrafi
Creator III
Creator III
Author

Hi Vishwarath,

Thank you for the solution, I will try it and let you know.

Kind regards

absekrafi
Creator III
Creator III
Author

Hi Dilip, Hi Vishwarath,

I created two fields startdate and enddate and two selections lists.

When I select the startdate the enddate is locked and in a cross table I put this expression:


count ({Date={'>=$(STARTDATE)<=$(ENDDATE)'}>} distinct QTEPROD but it didn't work.


STARTDATE and ENDDATE are to fields of a master calendar.


Thank you in advance,

Abdallah