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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem with counting the avarage

Hi,

I have 2 contracts : 7000000012 and 7000088270

These contracts are within different periods with some revenue connected with them:

7000000012 - 15-01 till 15-09


7000088270 - 15-01 till 15-04

I was counting the average using analysis and divisor like this for one contract :

=Count(distinct([Rok-Miesiąc]))

For the first one result will be 9, for the second will be 4.

So for 7000000012 whole revenue will be divided by 9

and for contract 7000088270  will be divided by 4.

But what if I choose 2 contratcs at the same time ?

It will be problem because my divisor will be 9 (because we have 9 rows for contracts)

Contract 7000000012 should be still divided by 9 but contract 7000088270 should be divided by 4 because this contract
is not null only for months 15-01 till 15-04.

Maybe you have any solution for this ?

Error.jpg

Thank you very much for your help,

Jacek Antek

4 Replies
sunny_talwar

May be this is what you are looking for:

=Count(DISTINCT TOTAL <ContractFieldName> [Rok-Miesiąc])

alexandros17
Partner - Champion III
Partner - Champion III

Try to aggr by contract ...

let me know

Anonymous
Not applicable
Author

Hi,

thank you for your answers.

Problem is that instead of contracts there could be more fields like contracts (with null), for example

Business units, companys, controlling objects etc.

So the answer would not be that easy...

It should be something counting not nulls under condition [Rok-Miesiąc].

Thank you in advance,

Jacek Antek

Anonymous
Not applicable
Author

Maybe Count(distinct([Rok-Miesiąc], not null()))

Question is how to do condition not null in set analysis?

thank you for your answers,

Jacek Antek