Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
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
alexandros17
Partner - Champion III
Partner - Champion III

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 ...

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

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
Author

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.

alexandros17
Partner - Champion III
Partner - Champion III

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
Author

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!