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: 
Anonymous
Not applicable

Script Help

Hi All,

I here has a question again. Assume I has following Inline table:

A:

LOAD * INLINE [

    ID, PRO

    A1, CA

    A1, SA

    A1, CA

    A1, FD

    A2, SA

    A3, CA

    A4, CA

    A4, SA

    A5, SA

    A5, FD

    A6, FD

    A6, CA

];

How can I come out with this result by using scripting?

Result:

  

IDTotal Product
A1CA & SA & FD
A2SA
A3CA
A4CA & SA
A5SA & FD
A6FD & CA

Thanks for help.

Regards.

1 Solution

Accepted Solutions
sunny_talwar

Try this:

A:

LOAD ID,

  Concat(DISTINCT PRO, ' & ') as [Total Product]

Group By ID;

LOAD * INLINE [

    ID, PRO

    A1, CA

    A1, SA

    A1, CA

    A1, FD

    A2, SA

    A3, CA

    A4, CA

    A4, SA

    A5, SA

    A5, FD

    A6, FD

    A6, CA

];


Capture.PNG


View solution in original post

2 Replies
sunny_talwar

Try this:

A:

LOAD ID,

  Concat(DISTINCT PRO, ' & ') as [Total Product]

Group By ID;

LOAD * INLINE [

    ID, PRO

    A1, CA

    A1, SA

    A1, CA

    A1, FD

    A2, SA

    A3, CA

    A4, CA

    A4, SA

    A5, SA

    A5, FD

    A6, FD

    A6, CA

];


Capture.PNG


Anonymous
Not applicable
Author

Hi Sunny,

I get the correct answer.Thanks for help.

Regards.