Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III

Returning Values of Field A if Field B has 2 or more Values

Hi all,

Consider that we have two fields A and B in the same table.

When i select Values in the field A, the values in B change accordingly.

I want to create a set analysis that returns the values in A, where the values contained in B have a count higher than 2.

I'm stuck in here, if someone can help me, i would appreciate.

Thanks!

Labels (4)
4 Replies
JordyWegman
Partner - Master
Partner - Master

Hi,

What separates the values in B? Are that spaces?

Jordy

Climber

Work smarter, not harder
50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III
Author

The values in both Fields are strings.

For example: 'This is an example'.

JordyWegman
Partner - Master
Partner - Master

I see you deleted your post, but if that is your field, try this:

=IF(Count(SubField(B,' ',1)) + Count(SubField(B,' ',2)) < 2,A, Null())

 You don't need set analysis for this.

Jordy

Climber

Work smarter, not harder
50ShadesOfSalty
Partner - Contributor III
Partner - Contributor III
Author

Yes, i'm new to qlik forum and didn't knew how the reply system work. Sorry 🙂

 

I guess i haven't explained myself correctly:

I want to have values in field A where the values in the Field B are more than 2.

 

For example:

Field A:

A1

A2

A3

 

Field B:

A1 1

A1 2

A1 3

A2  1

A3 1

A3 2

 

From the condition that i was trying to achieve, the values that should appear in the field A should only be A1, as long as A2 and A3 doesn't follow the condition:

 

if (  B > 2, A, Null

)

 

I don't know if i explained myself correctly or not. I'd gladly provide a sample, but i have strong restrictions on it.

 

Thanks for the time and help