Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

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

Count Distinct 2 fields in script?

Hi everyone,

I have a bar graph dimension:

FieldA

And I have a bar graph expression:

Count(DISTINCT FieldB & FieldC)

It works perfectly, however, I don't want FieldC to be available to everyone (I would like to drop it in the script).  However, I still need to be able to pivot on dimension A.  Is there any way to get just the count of distinct B & C for each A in the script, and then drop C?

Thank you

1 Solution

Accepted Solutions

Re: Count Distinct 2 fields in script?

I think that if you need that value in a chart you have to keep it somehow ...

Use the function autonumberhash(FieldA,FieldB) as myField, no one will evesìr suspect that the code created will contain a user id ...

4 Replies

Re: Count Distinct 2 fields in script?

Add a new field in the script

load

...

fieldA & FieldB as myField

...

From ...

Then you can delete FieldB and use myField in the expression

Not applicable

Re: Count Distinct 2 fields in script?

FieldB in my case is a user identification number, which I want to hide, so concatenating it to myField would still allow others to see and even sort it easily using Right().

I'm hoping to eliminate it entirely.  Scrambling it somehow may work, but I think there's a way to model it away - just struggling to find a way.

Re: Count Distinct 2 fields in script?

I think that if you need that value in a chart you have to keep it somehow ...

Use the function autonumberhash(FieldA,FieldB) as myField, no one will evesìr suspect that the code created will contain a user id ...

Not applicable

Re: Count Distinct 2 fields in script?

Ahh autonumber did it, thank you.  I was thinking it would scramble A, scramble B, and then concatenate them together, but it instead concatenates then scrambles, which is what I need.

Thank you!

Community Browser