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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
shekhar_analyti
Specialist
Specialist

How to concat Field Names , based on binomial values ?

Hi All ,

How to concat Field Names , based on binomial values and Save output in qvd .

conact criteria.bmp

Output Needed in QVD  , should be something like this  ;

conact criteria 2.bmp

Thanks & Regards

Shekar

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Binomial_Table:

Crosstable LOAD * INLINE [

    Roll_ID, S1, S2, S3, S4, S5, S6, S7, S8, S9, S10

    R001A1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1

    R001A2, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0

    R001A3, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1

    R001A4, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0

    R001A5, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0

    R001A6, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1

    R001A7, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1

    R001A8, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1

    R001A9, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1

    R001A10, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0

    R001A11, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1

    R001A12, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0

    R001A13, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1

    R001A14, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1

    R001A15, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1

    R001A16, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1

];


Final:

Load

Roll_ID,

      Concat( DISTINCT if (Value=1, Type), ',') as Blue,

      Concat( DISTINCT if (Value=0, Type), ',') as Red

Resident Binomial_Table Group By Roll_ID;


Store Final into Final.qvd(qvd);

View solution in original post

4 Replies
tresesco
MVP
MVP

1 's are blue and 0 's are red?

shekhar_analyti
Specialist
Specialist
Author

Hi Tresesco ,

Yes , you are correct .

tresesco
MVP
MVP

Try like:

Binomial_Table:

Crosstable LOAD * INLINE [

    Roll_ID, S1, S2, S3, S4, S5, S6, S7, S8, S9, S10

    R001A1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1

    R001A2, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0

    R001A3, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1

    R001A4, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0

    R001A5, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0

    R001A6, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1

    R001A7, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1

    R001A8, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1

    R001A9, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1

    R001A10, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0

    R001A11, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1

    R001A12, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0

    R001A13, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1

    R001A14, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1

    R001A15, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1

    R001A16, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1

];


Final:

Load

Roll_ID,

      Concat( DISTINCT if (Value=1, Type), ',') as Blue,

      Concat( DISTINCT if (Value=0, Type), ',') as Red

Resident Binomial_Table Group By Roll_ID;


Store Final into Final.qvd(qvd);

shekhar_analyti
Specialist
Specialist
Author

Got it , Thank You Tresesco  .