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: 
adrienL
Contributor
Contributor

Sort Field values into categories. Some values must be counted in several categories

Hello,
I recently started Qlik and need some help for this one.

I have a field that contains values like :

Field
A
B
C
A B
A B C

 

And I want to be able to count how many rows contains 'A','B' and 'C'.

So rows like 'AB' must be counted  once for each A and B

That would give :

Field_type count
A 3
B 3
C 2

 

How can i achieve that ?

Any help would be welcomed 🙂

4 Replies
anat
Master
Master

create new field using  subfield function at backend t,

then create table to count how many times char is repeating

anat
Master
Master

load *,subfield(field,' ') as nf;

load * inline [

field

A

B

C

A B

A B C

];

adrienL
Contributor
Contributor
Author

ty @anat 
subfield(field,' ') doest just fine !

anat
Master
Master

Test:

load *,subfield(field,' ') as nf;

load * inline [

field

A

B

C

A B

A B C

];

noconcatenate

Test1:

load nf,count(nf) resident Test group by nf;

drop table Test;