Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Single quote in a count expression

Hi,

I'm new to QlikView and I need help.

I want to count some products agreeing a condition with a single quote.

Example :

     "count({$ <CONTRACT={'Négociation en cours en vue d'un contrat'}> } DISTINCT PRODUCT)"

This : "count({$ <CONTRACT={'Négociation en cours en vue d'& chr(39) &'un contrat'}> } DISTINCT PRODUCT)" doesn't work.

Any idea ?

Thanks !

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi,

At a first glance, what I do is to double quote the whole name:

Count({< CONTRACT = {"Négociation en cours en vue d'un contrat"} >} DISTINCT PRODUCT)

Better off if you can create a numeric key for each contract in the load script, so you will never need to use single or double quotes irrespective the value of the field, because you will always use the numeric field in the set analysis. This will perform much better, too.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

View solution in original post

4 Replies
Miguel_Angel_Baeyens

Hi,

At a first glance, what I do is to double quote the whole name:

Count({< CONTRACT = {"Négociation en cours en vue d'un contrat"} >} DISTINCT PRODUCT)

Better off if you can create a numeric key for each contract in the load script, so you will never need to use single or double quotes irrespective the value of the field, because you will always use the numeric field in the set analysis. This will perform much better, too.

Hope that helps.

Miguel Angel Baeyens

BI Consultant

Comex Grupo Ibérica

SunilChauhan
Champion
Champion

hope this

count({$ <CONTRACT={$(='Négociation en cours en vue d'& chr(39) &'un contrat')}>}PRODUCT)

or

count({$ <CONTRACT={"$(='Négociation en cours en vue d'& chr(39) &'un contrat')"}>}PRODUCT)

Sunil Chauhan
Not applicable
Author

Thanks Miguel, this works perfectly well.

I take your advise also, I will change my datas.

Fred

Not applicable
Author

Thanks Sunil. The first solution doesn't work but the second does.

Fred