Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I would like to force the value of NbrLits to 6 for the field %KEY_Service = USI
Service:
LOAD DISTINCT
%KEY_Service,
NbrLits,
%KEY_Service as Service
FROM
[lib://PROJECT/Artemis 7_7/02 Transform/QVD/DimService.qvd](qvd)
Where
%KEY_Service='US1D' or
%KEY_Service='US2'or
%KEY_Service='US3' or
%KEY_Service='US4' or
%KEY_Service='USRZ' or
%KEY_Service='MAT' or
%KEY_Service='USI';
Thanks in advance !
Ethan
@Ethan0079 Please follow the Script below used in the Back end:
NoConcatenate
Temp:
Load * inline [
%Key_service,NbrLits, Service
US3,28,US3
US1,0,US1
US4,14,US4
USRZ,14,USRZ
US2,33,US2
MAT,13,MAT
US1D,11,US1D
];
NoConcatenate
Temp1:
Load %Key_service,
if(%Key_service='US1',6,NbrLits) as NbrLits,
Service
Resident Temp;
Drop table Temp;
Exit Script;
If this resolves the issue, please like and accept it as a solution.
Hi @Ethan0079
Depends on the data, is that a dimension or a measure? I would look at doing it in script and concatenate the value on you want. Otherwise you would need a calculated measure or dimension wrapped in an if statement
@Ethan0079 Please follow the Script below used in the Back end:
NoConcatenate
Temp:
Load * inline [
%Key_service,NbrLits, Service
US3,28,US3
US1,0,US1
US4,14,US4
USRZ,14,USRZ
US2,33,US2
MAT,13,MAT
US1D,11,US1D
];
NoConcatenate
Temp1:
Load %Key_service,
if(%Key_service='US1',6,NbrLits) as NbrLits,
Service
Resident Temp;
Drop table Temp;
Exit Script;
If this resolves the issue, please like and accept it as a solution.
@Ethan0079 if it's just this one value you intend to replace, perhaps an IF() would suffice
IF(Match(%KEY_Service,'USI'),6,NbrLits) as NbrLits
Otherwise, if there's quite a number, an appropriate way is to create a mapping table with the old and new values, and then perform a lookup to change all the old values to the new values.
hi @sidhiq91
Thanks for your answers it's works !
I juste have to change de name of the Table and %Key_service to %KEY_Service
@Ethan0079 You can also please like the post. Thanks