Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

AVG if

Hi all,

My table is like that and

I want to calculate the average of Tx de marge but I Don't want to take the value if date fin contrat <31/08/2018 and if Matricule facturation = INTERNE

Capture qlik 3.JPG

13 Replies
Anonymous
Not applicable
Author

Yes I do it in other expression and that' ok

Avg({<[Date fin de contrat]={">$(Date de reporting)"},[Matricule facturation]-={'INTERNE'}>}Marge)

But it Always doesn't take the value marge when [date fin de contrat] is empty

I try this one

Avg({<[Début de contrat]={"<=$(Date de reporting)"},[Date fin de contrat]-={"<$(Date de reporting)"},[Matricule facturation]-={'INTERNE'}>}Marge)

all the value if [Début de contrat] before (Date_var) and I exclude the value of [date fin de contrat] before (Date Var)

Anonymous
Not applicable
Author

but doesn't work

YoussefBelloum
Champion
Champion

Can't follow you anymore...

did your expected output change ?

because in your initial requirement you wasn't mentioning condition on field [Début de contrat]...

Anonymous
Not applicable
Author

no I didn't