Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey there,
I want to create a comma-separated string of values for my articles using a Mapping Table.
Is that possible? Here an example / Pseudo-Code
Mapping_Zustaende:
Mapping LOAD
BBT_WflLockStatusInst.Owning_Obj As %KEY_S_Artikel_BBT_WflLockStatusInst,
COMMA-SEPARATED-STRING(BBT_WflLockStatusInst.Zustand)
From
$(ImportPfad)BBT_WflLockStatusInst.qvd (qvd)
;
Thanks for your replies and Best Regards.
Ah, you want to create a string of comma separated value:
LOAD
article,
concat(information, ',', information) as [commaseperatedstring]
RESIDENT
Informations
GROUP BY
article;
You want to replace the key value in the target table with the comma separated string? That's no problem. What you cannot do with a mapping table is replace on key with multiple values. A field can have only one value. If you want to generate separate records in which in each record the key is replaced with a part of the comma separated string then you need to create a regular table and join that to the other table.
MainTable:
LOAD %KEY_S_Artikel_BBT_WflLockStatusInst,
...other fields...
FROM $(SomePath)SomeQvd (qvd);
LEFT JOIN (MainTable)
//ExplodedCommaSeparated:
LOAD
BBT_WflLockStatusInst.Owning_Obj As %KEY_S_Artikel_BBT_WflLockStatusInst,
SubField(COMMA-SEPARATED-STRING(BBT_WflLockStatusInst.Zustand),',') as CSS_Part
From
$(ImportPfad)BBT_WflLockStatusInst.qvd (qvd)
;
Hey,
thanks for you reply. I think I explained it wrong.
I have a table with my additional informations about my articles (one article can have several informations)
Informations:
LOAD * INLINE[
article, information
1, a
2, b
3, c
1, d
1, b
2, e
2, f
1, g
]
Then I have a Table with my articles. Now I want to add to this table one column with all informations to every articles. At example I want to get:
Articles:
1 | a,d,b,g
2 | b,e,f
3 | c
Is this possible with a Mapping Table?
Ah, you want to create a string of comma separated value:
LOAD
article,
concat(information, ',', information) as [commaseperatedstring]
RESIDENT
Informations
GROUP BY
article;