Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Counting in chart expression

Hi all,

I've a question regarding counting of children inside a hierarchy.

I have 2 fields: ID and ParentID.

I have to create a chart with ID as a dimension, and an expression that would count the number of children associated to the ParentID.

So, for example, if I have a table of IDs and ParentIDs

IDParentID
90100
80100
70100
6070
100-

I wanted to have a resulting table chart like this:

IDChildren
1003
900
800
701
600

How can I accomplish this task without writing load scripts?

I tried the expression:
count({<ParentID=ID>} ID)

but without any success.

Thanks.

Regards,
Valera

Labels (1)
2 Replies
Not applicable
Author

New chart (table type) -> add dimension ParentID -> add expression "=Count( Children )"

And uncheck "Supress zero values".

Anonymous
Not applicable
Author

Well, I can't do that because all my tables are connected through the field ID and not ParentID. So, I am forced to insert ID as my dimension if I want to add also other related fields from different tables like Name, Date, PurchaseValue etc.

Any ideas?