Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
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
Highlighted

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
Highlighted

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

chauhans85
Esteemed Contributor

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

Community Browser