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: 
pascos88
Creator II
Creator II

Formula with missing data

Hello everyone,

I have this problem.

In my chart I calculated a theoretical value like this :

=sum([KWh Real]/kWp)/Count(DISTINCT Company).

Whan I have all data, my theoretical value is good, the problem is whan the data missing.

The problem is that I always take the count(Company), but whan the data missing I should take just the number of the company that have the datas.

Someone can help me?

Regards

Pasquale

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Sum([KWh Real]/kWp)/Count(DISTINCT {<[KWh Real] = {"=Len(Trim([KWh Real])) > 0"}>} Company)


or


=Sum([KWh Real]/kWp)/Count(DISTINCT {<[KWh Real] = {"=Len(Trim([KWh Real])) > 0"}, kWp = {"=Len(Trim(kWp)) > 0"}>} Company)

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try something like:

If(isnull([KWh Real]),

Count(DISTINCT Company).,

sum([KWh Real]/kWp)/Count(DISTINCT Company)

)


Let me know

sunny_talwar

May be this:

=Sum([KWh Real]/kWp)/Count(DISTINCT {<[KWh Real] = {"=Len(Trim([KWh Real])) > 0"}>} Company)


or


=Sum([KWh Real]/kWp)/Count(DISTINCT {<[KWh Real] = {"=Len(Trim([KWh Real])) > 0"}, kWp = {"=Len(Trim(kWp)) > 0"}>} Company)

pascos88
Creator II
Creator II
Author

Hello Alessandro thanks for the response,

but with this formula I will have just a value, but I need to divide this count(Company) that have a value with

sum([KWh Real]/kWp).

pascos88
Creator II
Creator II
Author

Thanks Sunny

sunny_talwar

No problem