Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a new requirement :
If Dealer locates in Central region, then how to change it to East region.
Note: Dealer and Region are separate fields.
Regards,
Kavita
Maybe like this:
LOAD ParentGroup, if(ParentGroup = 'Konark Automobile', 'East', Region) as Region
FROM
(qvd) where region='Central' or region='West';
If you have more ParentGroups that should get another Region you can create a mapping table:
MapRegion:
LOAD * INLINE [
ParentGroup, Region
ABC, West
CDE, East
FGH, East
...etc
];
Then use the applymap function to do the mapping:
MyTable:
LOAD ParentGroup, applymap('MapRegion', ParentGroup, Region ) as Region
FROM
(qvd) where region='Central' or region='West';
Hi,
If this changes is only for one region.
Then write if statement in script
if(wildmatch(region,'Central'),'East',region)
If it is for all region then better if you maintain in excel sheet of inline table
try like
New_Region:
LOAD * INLINE[
Region,New_Region
Central, East
];
Due to Association old Region field will associated with new_Region field
Hope this solve your problem
Regards,
Change the value of the Region field for that dealer from Central to East. You can do this in the script or preferable in the source system where your data ultimately comes from. If you want to do this the hard way you can use a dynamic update action (Dynamic Update - Simple Database).
This change is only for specific dealer not for all the dealers.
Hi,
If possible, Post sample apps.
Regards,
Please provide the sample data
Hi,
Here is the sample data where the Parent group "Konark Automobile" belongs to "Central" region, which should be change to "West" Region.
Regards,
Kavita
Hi,
If you want to do this for mulitple Parent Group
Maintain Updated Parent Group with Old Region and New Region in Excel Sheet.
Then create key for ParentGroup&Region
Link between New Table with Existing Table using Key and Use New Region for Parent Group.
Try something like this.
Existing_Table:
Load ParentGroup,
Region,
ParentGroup&'-'&Region as Key
From existingTable;
//New_Table:
join
Load ParentGroup&'-'&Old_Region as Key
Temp_Region
From New_Excel_Table;
Final_table:
Load ParentGroup,
if(isNull(Temp_Region),Region,Temp_Region) as New_Region
Resident Existing_Table;
Drop table Existing_Table;
Regards
Maybe like this:
LOAD ParentGroup, if(ParentGroup = 'Konark Automobile', 'East', Region) as Region
FROM
(qvd) where region='Central' or region='West';
If you have more ParentGroups that should get another Region you can create a mapping table:
MapRegion:
LOAD * INLINE [
ParentGroup, Region
ABC, West
CDE, East
FGH, East
...etc
];
Then use the applymap function to do the mapping:
MyTable:
LOAD ParentGroup, applymap('MapRegion', ParentGroup, Region ) as Region
FROM
(qvd) where region='Central' or region='West';
Hi,
Thanks Gysbert !!!![]()
Following expression worked for me:
if(ParentGroup = 'Konark Automobile', 'East', Region) as Region