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

loop

hi !!

i have this table in the picture posted below and i want to add a new column where, for each row, appear only the name of the column that contain "1". What kind of string should i use to obtain this result??

Thx

PR1.JPG.jpg

2 Replies
kiranmanoharrode
Creator III
Creator III

hi Gabriele,

which object  u r using straight table ,Table box or pivot table for desired output?

rbecher
MVP
MVP

Hi Gabriele,

basically, this is a Crosstable problem:

Data:

LOAD * INLINE [

    F1, a, c, d, f, g, b, e, h

    R1, 0, 0, 0, 0, 0, 0, 1, 0

    R2, 0, 0, 0, 0, 0, 1, 0, 0

    R3, 0, 0, 0, 0, 0, 0, 0, 1

    R4, 0, 0, 0, 1, 0, 0, 0, 0

    R5, 0, 0, 0, 0, 0, 0, 1, 0

];

Cross:

CrossTable(Field, Value) LOAD * RESIDENT Data;

LEFT JOIN(Data) LOAD F1, Field Resident Cross Where Value=1;

Drop Tables Cross;

- Ralf

Astrato.io Head of R&D