Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
@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'))