Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Midastouch365
Contributor II
Contributor II

Function Handling

I am creating a KPI measure in Qlik Sense, and I am having trouble writing a function that counts the total number of null and not null files. 

So far, my code looks like this: Count(SourceFile)

But I want it to count all sourcefile, whether present or not present.

Could someone please guide me?

1 Solution

Accepted Solutions
Or
MVP
MVP

Count(coalesce(SourceFile,1)) should probably do it here. It'd be advisable to instead count a different field from the same table as SourceFile, though, which doesn't have null values. What's being counted is the number of rows with a non-null value, so it doesn't really matter if you count the SourceFile field or another field from the same table.

View solution in original post

3 Replies
Or
MVP
MVP

Count(coalesce(SourceFile,1)) should probably do it here. It'd be advisable to instead count a different field from the same table as SourceFile, though, which doesn't have null values. What's being counted is the number of rows with a non-null value, so it doesn't really matter if you count the SourceFile field or another field from the same table.

Midastouch365
Contributor II
Contributor II
Author

Thank you for this! This is really helpful. I ended up counting a different field instead based on your suggestion and it worked. However, Count(coalesce(SourceFile,1)) didn't give me the correct value that I was looking for.

vikasmahajan

Hello,

 

While loading data you can check nulls see below post

https://data-flair.training/blogs/qlik-sense-null-functions/

If(len(trim(Value))= 0 or Value='NULL' or Value='-', Null(), Value ) as ValueNullConv;

use this flags in set analysis to avoid null values

Regards

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.