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

Subfield and Count in Expression

Hello,

I have a column like below which has the data in a pipe delimited form,

UserSubject
User 1Maths|Chemistry|Physics
User 2Chemistry|Maths
User 3Physics
User 4Chemistry|Physics
User 5Physics|English

I want to get the Count of users for each of the subject.

Below is the output I am looking for and I am stuck up in getting the correct expressions in Dimension and in Expression.

SubjectUser Count
Maths2
Physics4
Chemistry3
English1

I am able to use Subfield(Subject,'|') for the calculated dimension and I am able to get the unique list of subject in the dimension. But I am not able to get the expression to get the count of users.

Thanks

Sarathi

2 Replies
tresesco
MVP
MVP

In the UI or script?

PFA for a script solution.

SubField(Subject, '|') as SubjectSeparated

Capture.JPG

sarathi_pm
Contributor II
Contributor II
Author

Hello Tresesco,

Thanks for the response. this is for Chart Dimension. I am able to get the output with the expression you have sent. But I am doing one more step on top of this.

When the user 1 logs in, I need to see the below output, When I add another expression for "Logged in User", that is not evaluating.

The output I am desiring is,

SubjectUser CountLogged in User
Maths21
Physics41
Chemistry31
English1

I am not using section access since I will not get the User Count from other users if use section access.

I using another table with NTName which is similar to the User.

Any help on how to achieve this?

Thanks

Sarathi