Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 
					
				
		
 Mahamed_Qlik
		
			Mahamed_Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Guyes,
I have query:
I have two filed in my data mode named as OriginCity and DestinationCity
| OriginCity | 
|---|
| London | 
| New York | 
| DestinationCity | 
|---|
| New York | 
| London | 
I want to create the new field named as CityPair, If I will create like this:'
OriginCity&'-'&DestinationCity as CityPair then i will get the result like :
| CityPair | 
|---|
| London-NewYork | 
| New York-London | 
Instead of this i will need only single row stating London-New York
Regards,
Mahamed
 
					
				
		
you can simply add one 'if' clause and restrict your data as per your requirement.
For example:
=if(OriginCityName<>DestinationCityName and len(OriginCityName)<>0 and len(DestinationCityName)<>0,RangeMinString(OriginCityName, DestinationCityName) &'-' & RangeMaxString(OriginCityName, DestinationCityName))
Hope this helps.
Regards,
Sakir
 
					
				
		
 Mark_Little
		
			Mark_Little
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
If they are in the same table just
Load
OriginCity&'-'&DestinationCity as CityPair
From Table;
If not you will have to look at join the tables first.
Mark
 
					
				
		
 Mahamed_Qlik
		
			Mahamed_Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Mark,
Thank you for your response.
But, if I will
Load
OriginCity&'-'&DestinationCity as CityPair
From Table;
Then I am getting two records which I had mentioned first.:
London - New York
New York - London
And I need it should show only first record as both falls under same route.
I need London - New York for both of them.
Kindly help.
Regards,
Mahamed
 
					
				
		
 nizamsha
		
			nizamsha
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		TableA:
Mapping
Load * Inline [
City,Dest
LO-NY,LO-NY
NY-LO,LO-NY
];
Load*,ApplyMap('TableA',NewDes)as NewDes1;
Load *,Origin&'-'&Destination as NewDes;
Load * Inline [
Origin,Destination
LO,NY
NY,LO
];
its one of the way mark it as correct or helpful if its satisfies you
 
					
				
		
 Mahamed_Qlik
		
			Mahamed_Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Nizam,
Can you please help me with the attached .qvw file ?
I do have separate filed for :
Origin city
Destination city
And I do have one filed Routcitypair, but this filed has only citycode and
I want to disply the description in the RoutcitypairName.
For example -
RoutePairCity - ABZ/OSL which mapped with
Aberdeen - oslo
oslo - Aberdeen
I want to create the field RoutcitypairName which should show
Aberdeen - oslo only.
Kindly help.
Regards,
Mahamed
 
					
				
		
 jonathandienst
		
			jonathandienst
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This will create only one value for each pair regardless of the direction:
RangeMinString(OriginCity, DestinationCity) & '-' & RangeMaxString(OriginCity, DestinationCity) as CityPair
 
					
				
		
 effinty2112
		
			effinty2112
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Mahamed,
Try:
RangeMinString(OriginCity,DestinationCity) &'-'& RangeMaxString(OriginCity,DestinationCity)as OrderedCityPair
| DestinationCity | OriginCity | CityPair | OrderedCityPair | 
|---|---|---|---|
| London | New York | New York-London | London-New York | 
| New York | London | London-New York | London-New York | 
Cheers
Andrew
 
					
				
		
 Mahamed_Qlik
		
			Mahamed_Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Jonathan,
I have tried and m not able to get the required field.
I have attached the sample copy of qvw.
Can you please check and revert with the applied .qvw
Regards,
Mahamed
 
					
				
		
 Mahamed_Qlik
		
			Mahamed_Qlik
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Jonathan,
I have tried and m not able to get the required field.
I am getting the records like
London- London
New York - New York too
Which I don't want.
I have attached the sample copy of qvw.
Can you please check and revert with the applied .qvw
Regards,
Mahamed
 
					
				
		
you can simply add one 'if' clause and restrict your data as per your requirement.
For example:
=if(OriginCityName<>DestinationCityName and len(OriginCityName)<>0 and len(DestinationCityName)<>0,RangeMinString(OriginCityName, DestinationCityName) &'-' & RangeMaxString(OriginCityName, DestinationCityName))
Hope this helps.
Regards,
Sakir
