Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Help with Expression Editor in Qlik Sense Cloud

Looking for help with Qlik Sense Cloud.  I am adding a measure to a bar graph.  I have a field (Comment) in my table that only has data in some lines.  I only want the graph to display a count on the lines that have a comment.  I was trying to write a "When" clause in the expression editor but I cannot seem to get it to work.

As an example, I may have a total of 50 lines but only 4 have data in the Comment field.  If I add 2 measures, 1 for total encounters and 1 for comment, I want to see 2 bars in the graph, 1 displaying all 50 Encounters and 1 displaying 4 Comments

Any assistance or suggestions would be greatly appreciated.

8 Replies
Michael_Tarallo
Employee
Employee

‌HI Steve I will post this in the main Qlik Sense forum to see if we can get you some assistance.

Regards

Mike T

Qlik

Regards,
Mike Tarallo
Qlik
Michael_Tarallo
Employee
Employee

Hi Steve, I attempted to play with this - let me know if this works, but we will definitely get you the help you need if this is not what you wanted.

I attached some sample data and the sample app

If using Qlik Sense Desktop please copy .qvf file to your C:\Users\<user profile>\Documents\Qlik\Sense\Apps and refresh Qlik Sense Desktop with F5. If using Qlik Sense Enterprise Server please import .qvf into your apps using the QMC - Qlik Management Console.

click to enlarge

I was using an expression like this for one of the measures:

if (Count(comment) > 0,Count(comment),0)

Let us know how you do.

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Michael_Tarallo
Employee
Employee

Sorry I made a mistake in the app - I will update the original reply

Regards,
Mike Tarallo
Qlik
Not applicable
Author

This does not work because the comment count will always be the number of total lines regardless of whether there is data in the field or not.  I am looking to only do the count if there is actual data in the "Comment" field.  Example, there are 50 lines of data.  Only 4 of those lines have something showing in the comment field.  I want the bar to only show a total of 4.

I was trying to do a where or when clause that is something like this:

Count(Comment)

Where(Comment) Is Not Null

Not applicable
Author

I'm using Qlik Sense Cloud

Michael_Tarallo
Employee
Employee

Hi Steve, understood - I reached out to one of our resident experts. They will take a look at the use case for you.

Regards,

Mike T

Qlik

Regards,
Mike Tarallo
Qlik
ArnadoSandoval
Specialist II
Specialist II

Hi Steve,

I downloaded Michael's Excel sample data and build a sample application in QlikSense Cloud, getting the results you are expecting, see screenshot, my comments expression is Count(Comment), it worked fine for me. Are you missing to share some information about your project?

Hope this helps

QS-Cust-Enc-Comments.png

Arnaldo Sandoval
A journey of a thousand miles begins with a single step.
Michael_Tarallo
Employee
Employee

Thanks Arnaldo - @Steve - is there anything else we can assist with?

When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik