Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
LINKEDIN LIVE: Democratizing data to enhance customer-centricity. JULY 29TH REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
davyqliks
Creator III
Creator III

Change dimension value if not match set values in dimension

I have a dimension with many Fibre names.

I would like to split out some values and group the others as others.

So, if not match the below, name as others.

I thought the below would work and in the dimension renamed as [Other Fibre 1] i would get the return

'Cotton – Organic' ,
' Cotton – Organic' ,
'Cotton – Organic ' ,
'Polyester - Recycled' ,
' Polyester - Recycled' ,
'Polyester - Recycled ' ,
'Viscose LENZING™ ECOVERO™' ,
' Viscose LENZING™ ECOVERO™' ,
'Viscose LENZING™ ECOVERO™ ' ,
'Viscose LENZING(tm)ECOVERO(tm)',
'Others1'


If(Len(Trim( "FIBRE 1")) > 0 and not match (
'Cotton – Organic' , ' Cotton – Organic' ,'Cotton – Organic ' ,
'Polyester - Recycled' , ' Polyester - Recycled' , 'Polyester - Recycled ' ,
'Viscose LENZING™ ECOVERO™' , ' Viscose LENZING™ ECOVERO™' ,'Viscose LENZING™ ECOVERO™ ' , 'Viscose LENZING(tm)ECOVERO(tm)',
'Lyocell Tencel®', ' Lyocell Tencel®' , ' Lyocell Tencel® '),

"FIBRE 1", 'Others1') as [Other Fibre 1],

 

Can someone assist to inform how i can achieve the required. thanks
(i cannot use a mapping as it will constantly need to be updated).

Thanks

 

Daniel

1 Solution

Accepted Solutions
PriyankaShivhare
Creator II
Creator II

May be like this:
if(Len(Trim(FibreName)) > 0 and wildmatch(trim(FibreName),'Cotton*','Polyester *','Viscose*',Lyocell *' ),'Others1','FIBRE1') as FibreGroup

Thanks,
Priyanka Shivhare

View solution in original post

4 Replies
PriyankaShivhare
Creator II
Creator II

May be like this:
if(Len(Trim(FibreName)) > 0 and wildmatch(trim(FibreName),'Cotton*','Polyester *','Viscose*',Lyocell *' ),'Others1','FIBRE1') as FibreGroup

Thanks,
Priyanka Shivhare

View solution in original post

davyqliks
Creator III
Creator III
Author

Thanks,

Will give this a go now, appreciate your time and effort 

Thanks

 

Daniel

davyqliks
Creator III
Creator III
Author

Hi,

This worked perfectly when i added 'not' to wildmatch.

thanks again for assisting with the syntax. most helpful!

i now get the required:

I cannot use the star approach to gather the gaps as viscose is a fabric on its on which needs filtering out as Others

davyqliks_0-1611317070502.png

Thank you.

Daniel

davyqliks
Creator III
Creator III
Author

Hello again,

I wonder if i can pick your brains again.

 

I thought the below would be returning All values listed in the below, as the field name  'Sustainable Fibres' in the dimension called  'Sustainable Fibres',

I need all of these

'Cotton – Organic' , ' Cotton – Organic' ,'Cotton – Organic ' ,
'Polyester - Recycled' , ' Polyester - Recycled' , 'Polyester - Recycled ' ,
'Viscose LENZING™ ECOVERO™' , ' Viscose LENZING™ ECOVERO™' ,'Viscose LENZING™ ECOVERO™ ' , 'Viscose LENZING(tm)ECOVERO(tm)',
'Lyocell Tencel®', ' Lyocell Tencel®' , 'Lyocell Tencel® '

 

To be called 'Sustainable Fibres' in the dimension called 'Sustainable Fibres'

 

I am not getting the required using the below script.

 

if(Len(Trim([Fibres])) > 0 and wildmatch(trim([Fibres]),
'Cotton – Organic' , ' Cotton – Organic' ,'Cotton – Organic ' ,
'Polyester - Recycled' , ' Polyester - Recycled' , 'Polyester - Recycled ' ,
'Viscose LENZING™ ECOVERO™' , ' Viscose LENZING™ ECOVERO™' ,'Viscose LENZING™ ECOVERO™ ' , 'Viscose LENZING(tm)ECOVERO(tm)',
'Lyocell Tencel®', ' Lyocell Tencel®' , 'Lyocell Tencel® ')
, 'Sustainable Fibres',
[Fibres]) as SustainableFibres,
Order_NoNum

Resident

[Sustainability Grouped]
;

 

Are you able to assist please?

Thank you agaiin,

Daniel