Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
DGAL1
Contributor III
Contributor III

COUNT OF CATEGORIZED ID

I have sale_id for categories such as furniture, appliances, and tools with ids such as
Furniture F-00 , F-01 , F-02
Appliances A-00 , A-01,A-02
Tools T-00, T-01,T-02
--How can I get  the count of each category using the last two digits 00, 01, 02

---How can i create a column that indicates -00 as First class , -01 as Second class and -03 as Used class.

Labels (2)
2 Replies
Cascader
Creator
Creator

 

Maybe something like :

Count(if(Left(sales_id,2)='F-', sale_id)) as F_Count

Count(if(Left(sales_id,2)='A-', sale_id)) as A_Count

Count(if(Left(sales_id,2)='T-', sale_id)) as T_Count

 

 

after that you can aggregate over Right(sale_id, 2)  to get count for each category id like 00,01,02

DGAL1
Contributor III
Contributor III
Author

@Cascader , thanks have structured it like this , thanks
=IF(Match(Right([ID], 2), '00'), 'First class',
IF(Match(Right([ID], 2), '01'), 'Second class',
'Other'))