Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Merge 2 IDs as single key

Hi guys,

I'am trying to merge 2 id's into one only, I've 2 keys in one table , 1215 and 1225 and i named them as AFTMARKET-1 and AFTMARKET-2 but now i want to merge both into AFTMARKET only, i want all values from 1215 and 1225 in the same.

1215 and 1225 are both raiserPlants.

Snippet of my script:

LOAD AETCNo as AetcId,

     Trim(upper(RaiserPlant)) as RaiserPlant,

FROM

[..\QVDs\test.qvd]

(qvd)

RaiserPlantsNames:

LOAD * INLINE [

    RaiserPlant, RaiserPlantName

    1121   ,otherPlants

    1215   ,NA Aftmkt-1

    1225   ,NA Aftmkt-2

    1128   ,otherPlants1

];

Thanks in advance.

Labels (1)
1 Solution

Accepted Solutions
tresB
Champion III
Champion III

Approach1:

LOAD AETCNo as AetcId,

     Trim(upper(RaiserPlant)) as RaiserPlant,

FROM

[..\QVDs\test.qvd]

(qvd);

RaiserPlantsNames:

LOAD * INLINE [

    RaiserPlant, RaiserPlantName

    1121   ,otherPlants

    1215   ,NA Aftmkt

    1225   ,NA Aftmkt

    1128   ,otherPlants1

];

Approach2:

LOAD AETCNo as AetcId,

     Trim(upper(If(WildMatch(RaiserPlantName,'NA Aftmkt*'),'NA Aftmkt')) as RaiserPlantName,

FROM

[..\QVDs\test.qvd]

(qvd);              // assuming that this qvd has already the mapped values in.

RaiserPlantsNames:

LOAD * INLINE [

    RaiserPlant, RaiserPlantName

    1121   ,otherPlants

    1215   ,NA Aftmkt-1

    1225   ,NA Aftmkt-2

    1128   ,otherPlants1

];

Update: Corrected the field name

View solution in original post

2 Replies
tresB
Champion III
Champion III

Approach1:

LOAD AETCNo as AetcId,

     Trim(upper(RaiserPlant)) as RaiserPlant,

FROM

[..\QVDs\test.qvd]

(qvd);

RaiserPlantsNames:

LOAD * INLINE [

    RaiserPlant, RaiserPlantName

    1121   ,otherPlants

    1215   ,NA Aftmkt

    1225   ,NA Aftmkt

    1128   ,otherPlants1

];

Approach2:

LOAD AETCNo as AetcId,

     Trim(upper(If(WildMatch(RaiserPlantName,'NA Aftmkt*'),'NA Aftmkt')) as RaiserPlantName,

FROM

[..\QVDs\test.qvd]

(qvd);              // assuming that this qvd has already the mapped values in.

RaiserPlantsNames:

LOAD * INLINE [

    RaiserPlant, RaiserPlantName

    1121   ,otherPlants

    1215   ,NA Aftmkt-1

    1225   ,NA Aftmkt-2

    1128   ,otherPlants1

];

Update: Corrected the field name

Not applicable
Author

Approach1 was simple and effective, thank you