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

Drop fields on run time

Hi All,

Please let me know how to implement drop field dynamically

Example :

Table 1:

Region Customer

A     ABC

B     BDE

Table2:

Region Customer

*           ABC

B          *

Drop field based on the Table 2 entry,

example:

first time it has to drop region field from Table 1 , bcoz * is entered in Table 2 Region Field

Second time it has to drop Customer field from Table 1 , bcoz * is entered in Table 2 Customer Field

Thanks in advance

3 Replies
Anil_Babu_Samineni

May be this?

Table1:

Load * Inline [

Region, Customer

A,     ABC

B,     BDE

];

Qualify *;

Table2:

Load * Inline [

Region ,Customer

*           ,ABC

B          ,*

];

Final:

NoConcatenate

If Table2.Region = '*' or Table2.Customer = '*' Then

Drop Field Table2.Region;

Else

Drop Field Table2.Customer;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
big_dreams
Creator III
Creator III

Can you explain real scenario??

Difficult to understand.

Regards,

el_aprendiz111
Specialist
Specialist

Hi,

Table1:
Load * Inline [
Region, Customer
A,     ABC
B,     BDE
]


;

Outer Join

Table2:
Load * Inline [
Region ,Customer
*,ABC
B,*
]

;



Mapping  Reg: LOAD Region,Customer Resident Table1    ;
Mapping  Cus: LOAD Customer,Region Resident Table1    ;



SUMARY:
LOAD *, ApplyMap('Cus',Customer,Null()) AS Region1,
ApplyMap('Reg',RegionNull())  AS Customer1
 
 
Resident Table1
  ;

DROP Table Table1;



mapp2.png