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

Join table so that output is sorted according to the city.

  Table 1  

RegionCity
West ThWest  Thane
West MuWest  Mumbai
East MuEast  Mumbai
South MuSouth  Mumbai
North ThNorth  Thane
North NaNorth  Nashik
West NaWest  Nashik
East NaEast  Nashik
South NaSouth  Nashik
West NaWest  Nagpur
North NaNorth  Nagpur
West PuWest  Pune
East PuEast  Pune
South PuSouth  Pune
North MuNorth  Mumbai
South ThSouth  Thane
North PuNorth  Pune
East ThEast  Thane
West RaWest  Raigad
North RaNorth  Raigad
North AhNorth  Ahmedabad
West AhWest  Ahmedabad

  Table 2  

NameMobileStatusRegion
Amit Prabhu9820261173MaharashtraWest Th
Narayan Nihalani9324764624MaharashtraWest Mu
Rameez Shaikh9930038445MaharashtraEast Mu
Deepak Soni8080106009MaharashtraSouth Mu
Muzammil Ansari9892964447MaharashtraNorth Th
Sandeep Patwa9222337250MaharashtraNorth Na
Warish Hashmi9699446027MaharashtraWest Na
Sarfaraz Ansari8080220160MaharashtraEast Na
Somnath Birajdar9220588835MaharashtraSouth Na
Saish Wagle8983915333MaharashtraWest Na
Shaeque Khan9987700440MaharashtraNorth Na
Paresh Kawa9930583258MaharashtraWest Pu
Abdul Kayyum  Shaikh9920290489MaharashtraEast Pu
Sarfaraz Mirza9930884114MaharashtraSouth Pu
Abdul Aamir  Shaikh 9545778881MaharashtraNorth Mu
Jiten Gala7666555055MaharashtraSouth Th
Salman Imran Kadiwal9819852367MaharashtraNorth Pu
Rupesh Pawar9220360005MaharashtraEast Th
Chirag Tailor7738240256MaharashtraWest Ra
Mohmad Idris Akbar  Shaikh 9222999710MaharashtraNorth Ra
Ankesh  8898101766MaharashtraNorth Ah
Sagar Bhangare9260435066Maharashtra

West Ah

How can we join this tables using joins and then sort according to the Region.

eg.

NameMobileStatusRegionCity
Amit Prabhu9820261173MaharashtraWest Th

West Thane

Narayan Nihalani9324764624MaharashtraWest MuWest Mumbai
Rameez Shaikh9930038445MaharashtraEast MuEast Mumbai
Deepak Soni8080106009MaharashtraSouth MuSouth Mumbai

and so on

****  The City name should be sorted such that All west thane should be together, all West Mumbai should be together...

2 Replies
sunny_talwar

Is there a reason for you to sort this in the script? You have to use this in the Aggr() function or something to make the load order sort work?

parimikittu
Creator II
Creator II

Hi,

Please find the sample code below. You cannot join and order at the same time as it will not give desired output and Order by will be applied on resident load only.

TabA:

load * inline [

Region, City

West Th, West  Thane

West Mu, West  Mumbai

East Mu, East  Mumbai

South Mu, South  Mumbai

North Th, North  Thane

North Na, North  Nashik];

right join(TabA)

TabB:

load * inline [

Name, Mobile, Status, Region

Amit Prabhu, 9820261173, Maharashtra, West Th

Narayan Nihalani, 9324764624, Maharashtra, West Mu

Rameez Shaikh, 9930038445, Maharashtra, East Mu

Deepak Soni, 8080106009, Maharashtra, South Mu

Muzammil Ansari, 9892964447, Maharashtra, North Th

Sandeep Patwa, 9222337250, Maharashtra, North Na

Warish Hashmi, 9699446027, Maharashtra, West Na

];

NoConcatenate

TABA_2:

load * Resident TabA order by Region;

drop table TabA;