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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
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 - Contributor II
Partner - Contributor II

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_R
Partner - Specialist
Partner - Specialist

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

 

Thanks and Regards
Kashyap.R