Discussion board where members can learn more about Qlik Sense App Development and Usage.
I have an Input Table with some raw data where I have Ids based on autonumber and some fields that looks like this :
and I'd like to change the Id that is related with a "keyField" because it means that it begins a new slot of a product. My desired result would be something like this :
How could you do this? Could you help me?
I've attached this example in an excel with the input and the desiredOutputTable.
Best regards, Marcel.
I made a quick response, this script can be optimised.
LOAD autonumber(Id&Field) as ID1, * INLINE [
load rowno() as ID2,* resident Data where Field='KeyField';
join load * resident Data;
drop table Data;
load * resident Temp order by Id;
drop table Temp;
load *,if(ID1=1,'$(a)',if(isnull(ID2),peek('IDtmp'),ID2)) as IDtmp resident Data2;
drop table Data2;
drop field ID1,Id,ID2;
rename field IDtmp to Id;
View solution in original post
Thanks @Taoufiq_ZARRA that's what I was looking for and it worked fine.