Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Create fag when two conditions are met

I would like to creat ea flag for when these two conditions are met:

IF(Count(Distinct(First_Key) <> Count(Distinct(Second_Key), 1, 0)))

but I don't quite get the syntax. Does this need to be a set analysis?

I just want to rerutn a 1 if the number of unque first_key is not the same as the number of unique second_key.

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You have some misplaced parentheses. This should work:

IF(Count(Distinct First_Key) <> Count(Distinct Second_Key), 1, 0)

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You have some misplaced parentheses. This should work:

IF(Count(Distinct First_Key) <> Count(Distinct Second_Key), 1, 0)

Regards

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein