Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jujurier
Contributor II
Contributor II

Transform field values in fields

Hello, I need to transform a dataset and i'm stuck in the process.

Example:

ID     Brand     Rating      Status

1          A             4                 General

1          B             2                 General

1          C             3                 Detail

2          A             1                 General

3          B             3                 General

I would like to end up with this structure: Create fields according to different values of Brand(A, B, C, etc...), and populate these fields with the Rating value:

ID         Status             A             B             C

1          General          4              2           

1          Detail                                             3

2          General          1

3          General                          3

Any help would be appreciated, thank you.

1 Solution

Accepted Solutions
Saravanan_Desingh

Try this,

tab1:
Generic
LOAD ID, Status, Brand, Rating;
LOAD * INLINE [
    ID, Brand, Rating, Status
    1, A, 4, General
    1, B, 2, General
    1, C, 3, Detail
    2, A, 1, General
    3, B, 3, General
];

View solution in original post

3 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Saravanan_Desingh

Try this,

tab1:
Generic
LOAD ID, Status, Brand, Rating;
LOAD * INLINE [
    ID, Brand, Rating, Status
    1, A, 4, General
    1, B, 2, General
    1, C, 3, Detail
    2, A, 1, General
    3, B, 3, General
];
Saravanan_Desingh

Output:

commQV89.PNG