# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
cancel
Showing results for
Did you mean:
Creator III

## Set analysis between two date

Hi,

I create two variable :

/*Current month*/

/*Next 7 months*/

I do this set analysis to calculate amount between current months and 7 next months :

=Sum({<[Date_rec] = {'>=\$(=vCurrentMonth)<=\$(=v7NextMont)'}>}[Amount])

But it's doesn't work.

Labels (3)

• ### Variables

1 Solution

Accepted Solutions
Creator III
Author

Hi @mark6505

I change my variable like this :

/*Mois courant*/

/*7 prochains mois*/

I obtain this two dates :

And my set analysis it's:

=Sum({<[Date_rec] = {'>=\$(=vCurrentMonth)<=\$(=v7NextMonth)'}>}[Amount])

And it's work !

Thanks ! 🙂

4 Replies
Specialist

can you add here your sample data for date and amount field

have to check your date format

Creator III
Author

Hi @NitinK7 ,

I have this data :

 Date_rec Amount july 2022 30 july 2022 40 May 2021 10 April 2020 10 March 2022 5

Example: We are in May 2022, I need to recover the amounts from May to November 2022.

Partner - Specialist III

Afternoon,

I would assume you set analysis is not work working as your variables are set to return month names. This will mean that the set analysis is trying to find a range between to string values. I.e.

Sum({<[Date_rec] = {'>=JAN<=FEB'}>}[Amount])

I believe your set analysis is correct. I would normally work with Full date on this kind of thing, so >=01/01/2022<=28/02/2022

Mark

Creator III
Author

Hi @mark6505

I change my variable like this :

/*Mois courant*/

/*7 prochains mois*/

I obtain this two dates :

And my set analysis it's:

=Sum({<[Date_rec] = {'>=\$(=vCurrentMonth)<=\$(=v7NextMonth)'}>}[Amount])

And it's work !

Thanks ! 🙂