Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
rajeshqvd
Creator II
Creator II

Re: Script creating new field

IDSubidAreaOutput
1111  
2221  
3331  
3332INDAUS/PAK/IND
3333PAKAUS/PAK/IND
3334 AUS/PAK/IND
3335AUSAUS/PAK/IND
2 Replies
sunny_talwar

Try this

Table:
LOAD * INLINE [
    ID, Subid, Area
    111, 1,  
    222, 1, 
    333, 2, IND
    333, 3, PAK
    333, 4,  
    333, 5, AUS
];

Left Join (Table)
LOAD ID,
	 Concat(DISTINCT Area, '/', -Subid) as Output
Resident Table
Group By ID;

or

Table:
LOAD * INLINE [
    ID, Subid, Area
    111, 1,  
    222, 1, 
    333, 2, IND
    333, 3, PAK
    333, 4,  
    333, 5, AUS
];

Left Join (Table)
LOAD ID,
	 Concat(Area, '/', -Subid) as Output
Resident Table
Group By ID;
rajeshqvd
Creator II
Creator II
Author

IDSubidAreaOutputRequired output
1111   
2221   
3332INDAUS//PAK/INDAUS//PAK/IND
3333PAKAUS//PAK/INDAUS//PAK/IND
3334 AUS//PAK/INDAUS//PAK/IND
3335AUSAUS//PAK/INDAUS//PAK/IND
4442 US/PAK/US/PAK
4443PAKUS/PAK/US/PAK
4444USUS/PAK/US/PAK
5551 AFG//AFG
5552 AFG//AFG
5553AFGAFG//AFG

 

required above output..... thanks for your quick response