Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
cbaqir
Specialist II
Specialist II

Count if match 2 fields in any order

I have FIELDA and FIELDB and I concatenate them in the script to be FIELDA_FIELDB. I then do a count to see how many occurrences we have of the matching pair of fields count(FIELDA_FIELDB). However, sometimes the same values could be listed as FIELDB_FIELDA. I want to group them together when the 2 fields are the same, regardless of which order they are in. Is there a way to do that?

1 Solution

Accepted Solutions
sunny_talwar

How do you combine them? May be combine them like this

RangeMaxString(FIELDA, FIELDB) & '_' & RangeMinString(FIELDA, FIELDB) as COMBINED_FIELD

View solution in original post

4 Replies
sunny_talwar

How do you combine them? May be combine them like this

RangeMaxString(FIELDA, FIELDB) & '_' & RangeMinString(FIELDA, FIELDB) as COMBINED_FIELD

cbaqir
Specialist II
Specialist II
Author

I was using FIELDA & '-' & FIELDB as FIELDA_FIELDB

cbaqir
Specialist II
Specialist II
Author

Sunny,

When I add the combined field as a dimension, I am still seeing one option for A_B and one for B_A.

What I am after is a way to combine them here. Any ideas?2018-10-23_14-11-13.jpg

swuehl
MVP
MVP

Are you really sure you are using Sunny's suggested calculated field and not yours?