Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Chart with count of $Field values

I want to create a straight table with dimension of "$Field" and expression of count() of field named in $Field. Pseudo code for expression would be something like:

=count( ValueOf($Field) )

I've tried:

=count($(='[' & [$Field] & ']'))

but that only works when one $Field value is selected.

Any ideas?

Thanks,

Rob

29 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP
Author

Ralf & Marcus,

Good solution. I'd like to mark them both correct but only one allowed.

-Rob

rbecher
MVP
MVP

Just to attach an example as a show case (integrated in a funny ancient QV app ;-).

Also added $Table as dimension but this seems to be a bit confusing. Key fields always have a count result of all occurances in all tables. But one can play around with dimensions and other expressions to find things.

Astrato.io Head of R&D
marcus_sommer

Ralf, excellent solution!

Not applicable

Hello There,

     It has been a long time since this thread is active. But it is usefull to for my reffrence.

My question:

How could we use something like the experssion that was dicussed to count the Blank values within a field Blank =''

  • $(=concat('if($Field=' & chr(39) & $Field & chr(39) & ',count({1}[' & $Field & '])', ',') & concat(right($Field&')',1))) 
rbecher
MVP
MVP

Hi Rayana,

this work to count fields with an empty string:

$(=concat('if($Field=' & chr(39) & $Field & chr(39) & ',count({1<[' & $Field & ']={""}>}[' & $Field & '])', ',') & concat(right($Field&')',1)))

- Ralf

Astrato.io Head of R&D
Not applicable

Thanks alot Ralf. Currently I am using this expression is QVDobserver.QVW you have created and it is perfomance is very solw as am loading a QVD that contain ~40,000 records but I am getting what I am expecting. Thanks any way and I looking forward to dicuss any perfomance tweaking ideas

rbecher
MVP
MVP

I was facing also perfomance issues. The only work around so far was to disable expression you do not need at the moment, so only a few are enabled at one time..

Astrato.io Head of R&D
kristof_j
Creator III
Creator III

And is it possible to add the fieldvalues to it?

What I want is a table with all or a selection of fields and with some expressions I could see de difference between 2 alternate states.

Something like this exemple:

Field          Value          state1     state2     difference

Country          A               100           80                   20

Country          B               100         120                  -20

Product          X                   6             6                     0

Product          Y                  10            0                   10

Not applicable

hi Ralf , that's excellent but I have a problem

when total number of  field from all tables exceed  the 99  all expressions return NULL

and when you select a table from any filter that's comeback with value !!

for test you can add some table from any source an see when field count exceed 99 what happen

Hassan

rbecher
MVP
MVP

Hi Hassan,

can you upload a sample QVW?

- Ralf

Astrato.io Head of R&D