Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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
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
This will create only one value for each pair regardless of the direction:
RangeMinString(OriginCity, DestinationCity) & '-' & RangeMaxString(OriginCity, DestinationCity) as CityPair
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
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
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