Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
MauriceLudo
Creator II
Creator II

Condition Date

Hi,

Please I would like to calculate the sum of sales before and after March 2018:

- if date > March 2018 : sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])

- if Date < March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])


please what is the best solution

Thank you

Best regards

Maurice

3 Replies
HarishG
Partner - Contributor III
Partner - Contributor III

Are you gonna use March 2018 static date?

MauriceLudo
Creator II
Creator II
Author

Yes

HarishG
Partner - Contributor III
Partner - Contributor III

May be this should work from what i understood with your requirement :

if(Max(Date)< 01-March-2018, sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS]),


sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])).

or

if(Max(Date)< '01-March-2018', sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS]),


if(Max(Date)>= '01-March-2018', sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])).

you need to change the march 2018 as per your Calendar date format. And instead of Max(Date), you can use Today().