Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a new field: from list of columns

Hi all,

Hope everyone is having a good day.

I have the following table:

BrandGiftcard1Giftcard2Giftcard3Giftcard4Giftcard5Giftcard6Giftcard7Giftcard8Giftcard9Giftcard10Giftcard11Giftcard12Giftcard13Giftcard14Giftcard15
Nike12345678912122323423323423322325672346735656578989656832456

For example, I have chosen on 15 giftcard colums. I have more than 300 in the real data.

on my Qlik application, I would like to show list of all gift cards. Is there any way to achieve it?

Best

Parth

1 Solution

Accepted Solutions
CarlosAMonroy
Creator III
Creator III

Hi Parth,

I suggest to use crosstable function in the script.

TableName:

CrossTable(GiftCardNum, GiftCardValue)

LOAD

Brand,

GiftCardNum,

GiftCardValue

From Source;

So you fan have an input like this:

Brand      GiftCardNum      GiftCardValue

Nike        Giftcard1               123

Nike        Giftcard2               456

and so on.

Hope that helps.

Carlos M

View solution in original post

4 Replies
adamdavi3s
Master
Master

What output is it you want exactly? Should be do-able!

Just a string with them all in?

CarlosAMonroy
Creator III
Creator III

Hi Parth,

I suggest to use crosstable function in the script.

TableName:

CrossTable(GiftCardNum, GiftCardValue)

LOAD

Brand,

GiftCardNum,

GiftCardValue

From Source;

So you fan have an input like this:

Brand      GiftCardNum      GiftCardValue

Nike        Giftcard1               123

Nike        Giftcard2               456

and so on.

Hope that helps.

Carlos M

adamdavi3s
Master
Master

Expanding on Carlos' answer, if you use LOAD * then it doesn't matter how many columns you have in your data, providing of course you just have the one leading column

Fact:

CrossTable(Giftcard1, Number)

LOAD *

FROM

[https://community.qlik.com/thread/253264]

(html, codepage is 1252, embedded labels, table is @1);

Not applicable
Author

Thank you both. I appreciate your help.

Best

Parth