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

Error in Calculated Expression error when using Count and Only Functions

Hello,

I am new  to QlikView  and having an issue with trying to get a chart to work. I added an expression in the expression tab to represent the denominator of the calculation:

Count(Only(MyField='Foo''))

However I get an error in calculated expression message. Am I allowed to embed a one function inside another when creating an expression? Basically I am using this as a SQL where claus e as I need multiple charts based on values found in 'MyField'. Any help would be greatly appreciated! Thanks.....

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can't just embed one aggregation function (and only() is also an aggregation function) within another like count().

(You could use aggr() function to get around this)

Or try maybe

= sum( if(MyField = 'Foo',1,0))

Stefan

View solution in original post

1 Reply
swuehl
MVP
MVP

You can't just embed one aggregation function (and only() is also an aggregation function) within another like count().

(You could use aggr() function to get around this)

Or try maybe

= sum( if(MyField = 'Foo',1,0))

Stefan