Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Not applicable

Re: Single quote in a count expression

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

4 Replies
Miguel_Angel_Baeyens
Not applicable

Re: Single quote in a count expression

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
Not applicable

Single quote in a count expression

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)

Not applicable

Single quote in a count expression

Thanks Miguel, this works perfectly well.

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

Fred

Not applicable

Single quote in a count expression

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

Fred