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
Read about the latest Qlik Community enhancements on the Community News blog!
cancel
Showing results for 
Search instead for 
Did you mean: 
karan_kn
Creator II
Creator II

Create a new field using multiple field values

Create a new field using multiple field values in the Load statement

 

IDField1Field2Field3
1A_Categ  
2 B_CategC_Categ
3  C_Categ
4A_Categ  
5 B_Categ 
6 B_Categ 
7A_Categ  
8  C_Categ
9A_Categ  
10 B_CategC_Categ

 

Ex result:

IDCombine field
1A_Categ
2B_Categ
2C_Categ
3C_Categ

 

 

4 Replies
Anil_Babu_Samineni

Perhaps this

Table:
CrossTable(Delete, [Combine field])
LOAD * FROM
[https://community.qlik.com/t5/New-to-Qlik-Sense/Create-a-new-field-using-multiple-field-values/m-p/1...]
(html, codepage is 1252, embedded labels, table is @1);

Final:
NoConcatenate
LOAD Distinct ID, [Combine field] Resident Table Where Len([Combine field])>0;

DROP Table Table;

Anil_Babu_Samineni_0-1610262674445.png

 

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
Vegar
MVP
MVP

Try using Crosstable () 

Crosstable (Field, [combined field], 1)

Load * from table ;

 

Plees ekskuse my Swenglish and or Norweglish spelling misstakes
karan_kn
Creator II
Creator II
Author

Thanks for the response, Is it possible to create using If condition or something, instead of Crosstable, as I'm having more values in the columns to ignore, sorry I didn't mention in the sample data.

Ex:

If(Match(Field1,'A_Categ'), 'A_Categ',
If(Match(Field2,'B_Categ'),'B_Categ',
If(Match(Field3,'C_Categ'),'C_Categ')) as Test1

Anil_Babu_Samineni

When you say you have many, I won't prefer the If..Else condition as it is required in your requirement rather I would go CrossTable() only. If CrossTable() not required what you expect, you should explain little more where it fails

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)