Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
MP1
New Contributor

LookUp Function

Hi, 

I have dataset that is in below format. There are around 100 columns in the original dataset.

Name

A1

A2

A3

A4

Sam

1

 

 

 

Linda

 

 

1

 

Richard

1

 

 

 

Sandy

 

1

 

 

Ben

 

 

 

1

Tom

 

 

 

1

 

I want to have a extra column which would return the name of column if the value is '1'.

Like Below table. What functions/logic can be used to achieve this. 

Name

A1

A2

A3

A4

Sample

Sam

1

 

 

 

A1

Richard

1

 

 

 

A1

Sandy

 

1

 

 

A2

Ben

 

 

 

1

A4

Tom

 

 

1

 

A3

 

 

Thanks In Advance for your help.

Labels (2)
3 Replies
MVP & Luminary
MVP & Luminary

Re: LookUp Function

I would probably use a crosstable like:

t1: crosstable(Type, Value, 1) load * from Source;

t2: load * resident t1 where Value = 1;

- Marcus

MP1
New Contributor

Re: LookUp Function

Hi Marcus,

Thanks for your reply.

I'm trying to test your query but I'm getting error for invalid path. For source I copied and used the same path that I used for load and select statement for the main table. I even tried using the table name as source but still getting error.

Would you have any idea what could be causing the error?

-MP

MVP & Luminary
MVP & Luminary

Re: LookUp Function

If you want to load data from a database you need to create a connection to the database and to store these information within a lib. Usually it's helpful to create the (first shot of) the load-statement with the wizard.

- Marcus