Skip to main content
You can succeed best and quickest by helping others to succeed. Join the conversation.
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering a definition by using if or where clause?

Hello everyone,

i have a table and in its function i add a "Count" function.

COUNT(DISTINCT keyattribute)

This works. So in the end i get a table with values on the left side and frequencies on the right side.

Now i want to filter this table in a way that a "WHERE" Clause is predefines.

This wont work for me.(example how it did not work)

COUNT(DISTINCT keyattribute) WHERE filterattribute='sn'

Now i also tried doing it with a if CLAUSE:

if(filterattribute='sn', COUNT(DISTINCT keyattribute)

At least this variant was syntactically correct, but it does not show the results i want it to. Output is just an empty table (i mean no frequencies.)

Can anyone help me here?

1 Solution

Accepted Solutions

How about using set analysis:

Count(DISTINCT {<filterattribute = {'sn'}>} keyattribute)

View solution in original post

3 Replies

How about using set analysis:

Count(DISTINCT {<filterattribute = {'sn'}>} keyattribute)

Master III
Master III

i think you missing closing bracket

try this

if(filterattribute='sn', COUNT(DISTINCT keyattribute))



Not applicable

Thanks a lot :-). This worked!