Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Merge two fields

Dear Experts,

I have two separate fields called "Customer" and "Suppliers"

The table logic is if the Customer Name is blank then there will be a supplier name filled and vice versa

Now I need to create a list box or a field where I want to show Type ie.Customer,Supplier and then after the selection the data needs to be refreshed based on that.

Kindly help me

Thanks & Regards

Jeba

1 Solution

Accepted Solutions
ashfaq_haseeb
Champion III
Champion III

Hi, look at the attachment.

Below code will do the work.

If(len(trim(Customer))=0,'Supplier','Customer') as Filter

Regards

ASHFAQ

View solution in original post

10 Replies
anbu1984
Master III
Master III

If(IsNull(Customer),Supplier,Customer)

Anonymous
Not applicable
Author

On what basis you are going to provide supplier name or Customer name even if its blank.

Can you post some sample data???

Is it a single fact table or different dimension tables??

Please elaborate..........

Regards

Nitin

Anonymous
Not applicable
Author

Hi Anbu,

Thanks for the reply.

However,this is listing the names of the Customers and Suppliers,but what I want to show in the list box is only two manual fields like below

Customer

Supplier

When user select "Customer" my table has to filter only the "Customer data" and vice versa

Kindly help

Thanks & Regards

Jeba

anbu1984
Master III
Master III

Can you attach sample app

Anonymous
Not applicable
Author

Hi Nitin,

These two are separate fields in a same table

Regards

Jeba

ashfaq_haseeb
Champion III
Champion III

Hi,

may be like this

If(len(trim(Customer))=0,Supplier,Customer)

Regards

ASHFAQ

Anonymous
Not applicable
Author

OK I got your point.....

First of all Use inline load for Customer and supplier...

Load * inline[

Field_Category

Customer

Supplier

];

Now create the list box of Field_Category at fron t end.

Now in your chart, provide Customer and Supplier bothin dimensions and provide the enable condition for both as

Customer >> if(getselectedcount(Field_Category)=1 and GetFieldSelections(Field_Category)='Customer',1,0)

Supplier >>   if(getselectedcount(Field_Category)=1 and GetFieldSelections(Field_Category)='Supplier',1,0)

Hope this will help you.

If required you can post your sample qvw...

Regards

Nitin

Anonymous
Not applicable
Author

Hi Anbu,

Please find attached the sample data.

Thanks & Regards

Jeba

ashfaq_haseeb
Champion III
Champion III

Hi, look at the attachment.

Below code will do the work.

If(len(trim(Customer))=0,'Supplier','Customer') as Filter

Regards

ASHFAQ