Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
shabarish0587
Contributor II
Contributor II

Combine mutiple columns into one column

Hi friends,

        I have few columns like ID, Status, Description, Reject_Rsn, Comment. from these columns i need to create a new column based on few search keywords. i created a column as category. But here i have three different category columns but i need to define these three  different category columns into one column. Can anyone help me on this. I am sharing sample code here: I have category like 1, 2 and 3 and i want to show in one column like Category with values like Details, Reason, Status.

if(status='withdrawn'
if(match(comment,'Null','N/A'),
if(match(description,'Null','N/A'),'Details'
))) as Category1

if(status='withdrawn',
if(Reject_Rsn='Id was submitted',
if(wildmatch(comment,'*Invalid**','**Mistake**'),'Reason'),

if(Reject_Rsn='Not available',
if(wildmatch(comment,'*Not repeated**','**Not Applicable**'),'Reason'),

if(Reject_Rsn='Duplicate ID',
if(wildmatch(comment,'*Duplicate**','**Simple**','Same'),'Reason'),

if(Reject_Rsn='Designed',
if(wildmatch(comment,'*Expected**','**Designed**'),'Reason'),

if(Reject_Rsn='Not to Fix',
if(wildmatch(comment,'*Business**','**Accept**','**Impact**'),'Reason')
)))))) as Category2

if(status='Withdrawn', if(not(match(comment, 'Withdrawn','Withdrawing')), if(not(match(Description, 'Withdrawn','Withdrawing')),
if(Reject_Rsn='Id was submitted',
if(wildmatch(comment,'*Invalid**','**Mistake**'),'Status'),

if(Reject_Rsn='Not available',
if(wildmatch(comment,'*Not repeated**','**Not Applicable**'),'Status'),

if(Reject_Rsn='Duplicate ID',
if(wildmatch(comment,'*Duplicate**','**Simple**','Same'),'Status'),

if(Reject_Rsn='Designed',
if(wildmatch(comment,'*Expected**','**Designed**'),'Status'),

if(Reject_Rsn='Not to Fix',
if(wildmatch(comment,'*Business**','**Accept**','**Impact**'),'Status')
))))))
))) as Category3

I tried using another method like creating flags and three different columns in one column by using concatenation, but i am not getting expected output. and i have a question here. can we use case condition instead of if condition. can anyone help me on this. Thanks in Advance



 

3 Replies
mato32188
Specialist
Specialist

Hi,
could you please share sample of data (xlsx, txt) with your source fields (Reject_Rsn, comment, etc.)?
Thank you.
Martin
ECG line chart is the most important visualization in your life.
shabarish0587
Contributor II
Contributor II
Author

Hi Martin,

 

        I am sharing sample file for that. can you please look into this.

 

Brett_Bleess
Former Employee
Former Employee

Best I have for you given I am not too swift when it comes to development, is to check out the following link and search around there, as I think you may be able to find something to help you there.  Hopefully this may allow you to move things forward.

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.