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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Issue with count in expression of a straight table

Hi, I have column name data_access in my table. It contains two values Public and non-Public . In my chart I have to prepare two columns, One will contain the count of public and other will contain the count of non-public for a particular Employee_ID. Something like I have shown in second table. I am using a straight table chart and in expression I am using  :

"if (Data_Access='Public',count(Data_Access))" but I am getting 0 where there are counts for both Public and non-Public for a record. Please help!

Employee_IDData_Access
1Public
1Non-Public
1Public
2Public
2Non-Public
3Public
3Non-Public
3Non-Public
3Public
3Non-Public
4Non-Public

Employee_IDPublicNon-Public
121
211
323
401
1 Solution

Accepted Solutions
Anil_Babu_Samineni

Perhaps this?

count({<Data_Access = {'Public'}>} Data_Access)

count({<Data_Access = {'Non-Public'}>} Data_Access)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
Anil_Babu_Samineni

Perhaps this?

count({<Data_Access = {'Public'}>} Data_Access)

count({<Data_Access = {'Non-Public'}>} Data_Access)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks Anil. I have used below in expression and it's working fine now:

count(distinct if(Data_Access='Public', Data_Access) )

Anil_Babu_Samineni

In fact, I don't prefer to use that. Instead try this and efficient

count({<Data_Access = {'Public'}>} DISTINCT Data_Access)


Note - Please close this thread (Information available Qlik Community Tip: Marking Replies as Correct or Helpful)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful