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

Error in Expression

Can anyone assist with tracing the error in the following expression:

Count(DISTINCT({<[Doctor Name]={'PIM'}>}[Script Number])) + Count(DISTINCT({<[Doctor Name]={'PID'}>}[Script Number]))

Regards


1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would say that Set expression comes before the DISTINCT keyword like this:

Count({<[Doctor Name]={'PIM'}>} DISTINCT [Script Number]) + Count({<[Doctor Name]={'PID'}>} DISTINCT [Script Number])

-Rob

View solution in original post

6 Replies
Not applicable
Author

Change like this.

=Count  (distinct {<[Doctor Name]={'PIM'}>}[Script Number]) + Count( distinct {<[Doctor Name]={'PID'}>}[Script Number])

"Distinct" is not a function.

Anonymous
Not applicable
Author

you have extra brackets: no brackets necessary after distinct...try this

Count(DISTINCT {<[Doctor Name]={'PIM'}>}[Script Number]) + Count(DISTINCT {<[Doctor Name]={'PID'}>}[Script Number]))

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I would say that Set expression comes before the DISTINCT keyword like this:

Count({<[Doctor Name]={'PIM'}>} DISTINCT [Script Number]) + Count({<[Doctor Name]={'PID'}>} DISTINCT [Script Number])

-Rob

Anonymous
Not applicable
Author

Hi Rob

Many thanks, you are right, that works.

Regards.

Chris

Anonymous
Not applicable
Author

Many thanks, I used Rob's recommendations.

Anonymous
Not applicable
Author

Many thanks.  I used Rob's recommendations