Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
Is it possible to rename the data values that is being pulled from database?
For instance,
NatureOfWork:
LOAD
NatureOfWorkID,
NatureOfWork
FROM [lib://Master/NatureOfWork.qvd]
(qvd);
The NatureOfWork field contains values as 'Cots', 'Application Development', 'Analytics'
Now I want to change 'Application Development' to 'AppDev'.
Thanks
Use this;
NatureOfWork:
LOAD
NatureOfWorkID,
if(NatureOfWork='Application Development','AppDev',NatureOfWork) as NatureOfWork
FROM [lib://Master/NatureOfWork.qvd]
(qvd);
Use this;
NatureOfWork:
LOAD
NatureOfWorkID,
if(NatureOfWork='Application Development','AppDev',NatureOfWork) as NatureOfWork
FROM [lib://Master/NatureOfWork.qvd]
(qvd);
Suppose I want to use both the names, then is resident load a good idea?
Example:
In a single sheet,
In 1st table : I should display Application Development
In 2nd : I need to display it as AppDev
However, linkage with other fields should remain the same. Only the display name should be changed.
Hi,
In that case just keep the original field and calculated field as new field so that you can use it both table by calling seprate column. Tks
NatureOfWork:
LOAD
NatureOfWorkID,
NatureOfWork,
if(NatureOfWork='Application Development','AppDev',NatureOfWork) as NatureOfWork_Short
FROM [lib://Master/NatureOfWork.qvd]
(qvd);
Tks,Deva
Added to this I want to change 2 names,
Application Development' to 'AppDev' and 'Cots' to 'Off-shelf'
both of these should be present in the same table (that is newly renamed table)
P.S Sorry forgot to mention the above previously
Hi,
Like this,
NatureOfWork:
LOAD
NatureOfWorkID,
NatureOfWork,
pick(match(NatureOfWork, 'Application Development', 'Cots'), 'AppDev','Off-shelf') as NatureOfWork_Short
FROM [lib://Master/NatureOfWork.qvd]
(qvd);
Many thanks.. It worked perfectly!
Hi,
Just added else condition for revised short name field. so that new calculated field should return complete data set as result. tks
Data:
LOAD * INLINE [
NatureOfWork
Application Development
Infra Side
Marketing
Finace
Analyst
Developer
Admin,
Cots
];
Fact:
Load*,
if(WildMatch( NatureOfWork, 'Application Development'),'AppDev',
if(NatureOfWork='Cots','Off-shelf',NatureOfWork)) as NatureOfWork_Short
Resident Data;
Drop table Data;
Hi,
below Expression is much better than several layers of nested If()s.
just Using WildMatch() function able added default value as well:
Data:
Load *,
Pick( WildMatch(NatureOfWork, 'Application Development', 'Cots','*'), 'AppDev', 'Off-shelf', NatureOfWork) as NatureOfWork_Short;
LOAD * INLINE [
NatureOfWork
Application Development
Infra Side
Marketing
Finace
Analyst
Developer
Admin,
Cots
];
Hope this helps
Regards,
Deva
It works. Thank you.