Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld 2022, LIVE in Denver CO., May 16-19, 2022. REGISTER NOW TO RECEIVE EARLY BIRD PRICING
cancel
Showing results for 
Search instead for 
Did you mean: 
ehasnawi98
Contributor II
Contributor II

How to count a selected attribute but must separate the multiple attribute that the another column h

Hello , i  have a data for example

Name              Labels

A                        Man, Kind

B                        Man, Kind

C                        Man

D                       Woman , Kind

E                        Woman 

 

i want to count the labels in that data, but when i put the .xlsx to qliksense , the result when i transform it to pie chart will be : man,kind : 2 ; man :1 ; woman,kind:1;woman:1

what i want is man:3 ; kind:3; woman :3

how to count and split the attribute?

2 Replies
subaru
Partner
Partner

Hi,

Tried this in the script:

Original:
Load Names,
Trim(Subfield(Labels,',',1)) as Labels,
Trim(SubField(Labels, ',',2)) as TempLabels;
LOAD * INLINE [
Names, Labels
A , "Man, Kind"
B , "Man, Kind"
C , "Man"
D , "Woman, Kind"
E , "Woman"
];

Concatenate
Load Names,
TempLabels as Labels
Resident Original
where not isNull(TempLabels);

drop field TempLabels from Original;

 

Regards,

Ayush

kashyap
Partner
Partner

Hi 

I tried by loading the data manually 

CC:
Load * Inline [
'Names' , 'Labels'
A , 'Man,Kind'
B , 'Man,Kind'
C , Man
D , 'Woman,Kind'
E , Woman ];

CT:
Load
Trim(Subfield(Labels, ',')) AS Label,
*
Resident CC;
Drop Table CC;

Please find output in the attachment

 

Hope it helps 

Thanks