Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
you can try this:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<032018"}>}[VENTE PRIS])
but before doing this, you should know the format of your date field, example
1. if your date field format is: DD/MM/YYYY:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<01/03/2018"}>}[VENTE PRIS])
2. if your date field format is: MMYYYY
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={"<032018"}>}[VENTE PRIS])
Also, your date field must be evaluated as a date
Thank you,
but for the seconde condition
if Date > March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])
how to do?
Same as above, just replace < by >
example:
sum({<[Produits/Services]={'NSS & CCD '},DATE_FIELD={">032018"}>}[VENTE PRIS])
if date > March 2018 : sum({<[Produits/Services]={'NSS & CCD '}>}[VENTE PRIS])
- if Date < March 2018 : sum({<[Produits/Services]={'NSS'}>}[VENTE PRIS])
ah sorry, I didn't pay enough attention on this one, so try this:
sum({<[Produits/Services]={'NSS'},DATE_FIELD={">032018"}>}[VENTE PRIS])