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: 
Not applicable

[QlikView] How to select a date between two dates

Hello,

I would like to select from a list of selection a date. This selected date would then allow me to display the start date of the contract and the date of end of contract. So, we have a date interval in which our selected date must be included. I use "set analysis" but it does not work ".

Capture.PNG

=Sum({$

<[Année début de validité] = {">=$(=Année1)"}>*

<[Année fin de la période de validité] = {"<=$(=Année1)"}>*

<[Mois début de validité] = {">=$(=Mois1)"}>

*<Mois1 = {"<=$(=[Mois fin de la période de validité])"}>

} [Début de validité])

1 Solution

Accepted Solutions
Not applicable
Author

Ok, i have a correct answer. I have used some MakeDate function to regroup my field Year and Month together and compare them to my date with this setAnalysis :

=Sum({$ <YMD = {"<=$(=YM)"}> * <YMF = {">=$(=YM)"}>} [Début de validité])

Lexique : YMD : Year,Month,Début;     YMF: Year,Month,Fin and YM: Year,Month

Have a nice day,

Alex

View solution in original post

11 Replies
Anonymous
Not applicable
Author

could you post some sample data please , English prefered

Not applicable
Author

Capture2.PNG

I want that from the date(Année, Mois) I select from the two bars at the top, qlikview displays me all entries where this date is between  "debut de validite" and "fin de la période"

This code work to to find by year :

=Sum({$

<[Année début de validité] = {">=$(=Année1)"}> /

<[Année fin de la période de validité] = {"<=$(=Année1)"}>} [Début de validité])

But i want a selection by Years AND Months. There isn't any relation between the two bars at the top and the list at the bottom.

Thanks for your help

prachisangewar
Creator
Creator

Hi,

Instead of the two blocks (one for Year and one for Month) you can create two calendar objects to Select the Start Date and End Date.

You can go through the below video for the steps.

Selecting Arbitrary Date Ranges

Not applicable
Author

My fields are declared like this :

Capture3.PNG

Not applicable
Author

In SQL language, my request will be :

SELECT * from [début de validité], [Fin de la période de validité] where Année1>=[Année début de validité] AND Année1<=[Année fin de la période de validité] -> (Select * where Mois1>=[Année début de validité] AND Mois1<=[Mois fin de la période de validité])

Anil_Babu_Samineni

Does Année1 & Mois1 are related each??

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Not applicable
Author

They aren't related

Not applicable
Author

Ok thanks, let's see how to create calendar objects, thanks

Not applicable
Author

I think calendar object can't help me because i want the user have only to clik on a Year or a Month to display the result, it's faster for the user