Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
hammermill21
Creator III
Creator III

Combining Data From One Table

Hello everyone,

I have one table:

LOAD

[ID] AS [Record ID],

[CREATED_DATE] AS [CREATED_DATE],

[CREATED_BY] AS [CREATED_BY],

[equip] AS [Type Equipment],

[equiploc] AS [Location],

[firex_type] AS [firex_type],

[firex_size] AS [firex_size],

[bc_num] AS [Scanned BarCode Number],

[building] AS [Building],

[floor] AS [floor],

[my_scan] AS [Scanned Bar Code],

[completed_] AS [completed_],

[tech_] AS [tech_],

[retired_barcode] AS [retired_barcode],

[new_barcode_] AS [new_barcode_],

[comments] AS [comments],

[buidling] AS [Other Buidling]

But both [bc_num] AS [Scanned BarCode Number] & [my_scan] AS [Scanned Bar Code] can have the same number, no number or just one of them has the number. So what I want it to do is combine them so that it displays in my table just one number:


I tried combing them by adding:


bc_num] &'-'& [my_scan] AS [Barcode Number],


But that gives me data like this:

Capture.PNG


What I need is for it to show the number just once.


Any ideas?


Thanks!


1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this?

Subfield([bc_num] &'-'& [my_scan], '-',1) AS [Barcode Number],

View solution in original post

4 Replies
YoussefBelloum
Champion
Champion

Hi,

try this:

if(len(trim(bc_num))=0, my_scan, if(len(trim(my_scan))=0, bc_num)) as [Barcode Number],

vishsaggi
Champion III
Champion III

Try this?

Subfield([bc_num] &'-'& [my_scan], '-',1) AS [Barcode Number],

hammermill21
Creator III
Creator III
Author

This worked perfectly! So I needed to use Subfield. Thank you!

vishsaggi
Champion III
Champion III

Yes. No Problem.