Skip to content

Instantly share code, notes, and snippets.

@ralfbecher
Last active December 22, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/6410762 to your computer and use it in GitHub Desktop.
Save ralfbecher/6410762 to your computer and use it in GitHub Desktop.
Having a straight table chart in QlikView with $Field as dimension to count the occurances of values per field. The given expression creates a nested if()-function like this: if($Field='FieldName1',count(FieldName1),if($Field='FieldName2',count(FieldName2), ... etc. Hint: Concat() aggregation function seems to be the only one which works with $F…
// expression for count($Field), no leading '=':
$(=concat(TOTAL 'if($Field=' & chr(39) & $Field & chr(39) & ',count([' & $Field & '])', ',') & concat(TOTAL right($Field&')',1)))
// expression for count(DISTINCT $Field):
=FieldValueCount($Field)
@bleblesjo
Copy link

Excellent post. Just what I was looking for!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment