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

N/N-1

Bonjour,

je voudrais comparer les commandes de l'année avec celles de l'année dernière

les commandes de cette années s'écrivent :   count ( DISTINCT [Numero Facture Compta])

j'ai donc rentré la formule :

count ( DISTINCT [Numero Facture Compta])
-
count ( {$[Année mouvement]={$(=[Année mouvement]-1 )} ,  DISTINCT [Numero Facture Compta])

mais ça ne fonctionne pas. quelqu'un a une idée ???

Merci d'avance

1 Solution

Accepted Solutions
crusader_
Partner - Specialist
Partner - Specialist

I forgot about <> and NO commas(!)


count( {$<[Année mouvement]={$(=[Année mouvement]-1 )}> } DISTINCT [Numero Facture Compta])

Check above

View solution in original post

5 Replies
crusader_
Partner - Specialist
Partner - Specialist

Hi,

Please check whether is comma count( {$[Année mouvement]={$(=[Année mouvement]-1 )} }, DISTINCT [Numero Facture Compta]) is a type mistake. And you missed } bracket.


Edited:

     count( {$<[Année mouvement]={$(=[Année mouvement]-1 )}> } DISTINCT [Numero Facture Compta])

Hope this helps.


Andrei

alexandros17
Partner - Champion III
Partner - Champion III

Set 2 variables in your script in this way:

LET CurrYear = Year(Today());

LET PrevYear = Year(Today())-1;

Then your expression will be:

count ({$ <[Année mouvement] = {$(CurrYear))}>} DISTINCT [Numero Facture Compta])

-

count ({$ <[Année mouvement] = {$(PrevYear)}>}  DISTINCT [Numero Facture Compta])


Let me know ...

Anonymous
Not applicable
Author

I tried this :

count ( DISTINCT [Numero Facture Compta])
-
count ( {$[Année mouvement]={$(=[Année mouvement]-1 )}}, DISTINCT [Numero Facture Compta])

did not work. the first "DISTINCT" is in blue, the second one stay in black, so there should still be a mistake somewhere ? thanks for your help.

crusader_
Partner - Specialist
Partner - Specialist

I forgot about <> and NO commas(!)


count( {$<[Année mouvement]={$(=[Année mouvement]-1 )}> } DISTINCT [Numero Facture Compta])

Check above

Anonymous
Not applicable
Author

it works :-))

many thanks. regards