# New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
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

Tags (1)
1 Solution

Accepted Solutions
Highlighted
Contributor II

## Re: Count of String in expression

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

Hope this is helpful to you.

9 Replies
Highlighted

## Re: Count of String in expression

Why not, Simply Count([Product Name])

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Highlighted
Contributor II

## Re: Count of String in expression

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 ?
Highlighted
Valued Contributor

## Re: Count of String in expression

Something like this ,

Highlighted
Not applicable

## Re: Count of String in expression

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
Valued Contributor

Output:

Dim:

Exp:

Highlighted
Contributor II

## Re: Count of String in expression

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

Hope this is helpful to you.

Highlighted
Valued Contributor

## Re: Count of String in expression

Kavya can try it.

Highlighted
Not applicable

## Re: Count of String in expression

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.

then you get out put like this

Highlighted
Not applicable

Thanks everyone