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

Count of String in expression

Hi All,

Looking for product count  based on product ID in expression but product  Count should display  product name (string) ..like how we display in table and  count should be  4.

   

Product IDsum(sale)Product NameProduct count
110ABCABC
220DGCDGC
310JHGJHG
420HBCHBC
Total60 4

Thanks in advance

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Try this expression: if(Dimensionality() = 0, Count(DISTINCT [Product ID]),  [Product Name])

Hope this is helpful to you.

View solution in original post

9 Replies
Anil_Babu_Samineni

Why not, Simply Count([Product Name])

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

Is that you want to display

  1. Product name in Product count field? and
  2. in Product count field - total you want to display 4 ?
varshavig12
Specialist
Specialist

Something like this ,

Not applicable
Author

Yes i want to display 

  1. Product name in Product count field and
  2. in Product count field   i  want to display total count  4 . This total count is based on  Product ID
varshavig12
Specialist
Specialist

Output:

Dim:

Exp:

Anonymous
Not applicable
Author

Try this expression: if(Dimensionality() = 0, Count(DISTINCT [Product ID]),  [Product Name])

Hope this is helpful to you.

varshavig12
Specialist
Specialist

Kavya can try it.

Not applicable
Author

Hi Kavya Shree,

I think are you Expecting only total count? if yes,Do like this

Just write the Expression If(product-id = product-id,' ')  just give the space

and select text count inTotal mode.

2017-01-06_1555.png

then you get out put like this

2017-01-06_1557.png

Not applicable
Author

Thanks everyone