Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

Add a column in QV

Hi I load the data and create a table like the following:

ProductGrade
A1
B4
C3
D2
E5
F3
G2
H4
I1

But Actually I would like to add a column 'Team' which does not exist in my original dataset. And the table followed is what I want.

TeamProductGrade
X1A1
X2B4
X3C3
D2
X4E5
F3
G2
X5H4
X6I1

What should I do?

1 Solution

Accepted Solutions

Re: Re: Add a column in QV

Orig:

LOAD * Inline [

Product, Grade

A, 3

B, 5

C, 2

D, 1

E, 5

F, 4

G, 1

H, 3

I, 2

];

Final:

NoConcatenate

LOAD

  Product,

  Grade,

  If(Product='A','X1', If(Product='B','X2', If(WildMatch(Product,'C','D','E'),'X3', If(WildMatch(Product,'F','G','H','I'),'X4', 'XX' )))) as Team

Resident Orig;

DROP Table Orig;

6 Replies

Re: Add a column in QV

I think that Team field is created according to a logic so when you load the original table:

LOAD

     Product,

     Grade,

     if(mycondition, newField, null()) as Team

From ...

Hope it helps

Not applicable

Re: Re: Add a column in QV

May be I just give a wrong table..Sorry for  that.

What I would like to create is like the following:

TeamProductGrade
X1A3
X2B5
X3C2
D1
E5
X4F4
G1
H3
I2
alokpande28
New Contributor II

Re: Add a column in QV

Hi Jelly,

I suggest you that,

You Can Create Master Excel File for this & You can maintain @ 1 Place.

Which Contains Team & Product. & then you can Map That File with System Data.

Regards,

Re: Re: Add a column in QV

Orig:

LOAD * Inline [

Product, Grade

A, 3

B, 5

C, 2

D, 1

E, 5

F, 4

G, 1

H, 3

I, 2

];

Final:

NoConcatenate

LOAD

  Product,

  Grade,

  If(Product='A','X1', If(Product='B','X2', If(WildMatch(Product,'C','D','E'),'X3', If(WildMatch(Product,'F','G','H','I'),'X4', 'XX' )))) as Team

Resident Orig;

DROP Table Orig;

Not applicable

Re: Re: Add a column in QV

Yes your method is work..

What's more..is there a function in QV that could merge the cells?

Not applicable

Re: Re: Add a column in QV

Thanks..I just try the metod porvided by @Alexandros17 and I can work..

Community Browser