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
Customer & Partners, DEC. 9, 11 AM ET: Qlik Product & Strategy Roadmap Session: Data Analytics REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rupaliqlik
Creator
Creator

How to use subfield function with if else

Hi Team,

I want to convert the string. Kindly help me here.

I am writing below condition in scrip level  which gave me correct ouput where ':' sign is present but other highlighted korean string is ignored so which give blank product cat in front of materail id.

Please help me how to write here.

subfield(Product_Cat,':',2) as Product_Cat_Jap,

rupaliqlik_0-1634797886548.png

Thanks,

Rupali

@sunny_talwar @jagan  @abhijitnalekar @ kaushik.solanki ,@

4 Replies
abhijitnalekar
Specialist
Specialist

Hi @rupaliqlik ,

 

Add one more condition like

if (match(Product_Cat,':')>0, subfield(Product_Cat,':',2) , Product_Cat) 

Hope this solves the purpose

Regards,
Abhijit
keep Qliking...
rupaliqlik
Creator
Creator
Author

HI @abhijitnalekar 

I tried below logic and it works. Is this correct ?

If(FindOneOf( Product_Cat, ':'),subfield(Product_Cat,':',2),[商品サブカテゴリ]) as Product_Cat_Jap,

Thanks ,

Rupali

 

 

abhijitnalekar
Specialist
Specialist

If(FindOneOf( Product_Cat, ':')>0,subfield(Product_Cat,':',2),[商品サブカテゴリ]) as Product_Cat_Jap,

Regards,
Abhijit
keep Qliking...
Vegar
MVP
MVP

Looking at your sample it seems like you are trying to get the last subfield value separately by ':' for Product_Cat.

Maybe you can simplfy your expression to this:

subfield(Product_Cat,':',-1) as Product_Cat_Japan

Plees ekskuse my Swenglish and or Norweglish spelling misstakes