Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

constantin_olar
Contributor III

How to split the values into a column

Hi there,

 

I have a qvd where I want to split the values of one column, the find below the format of the table.

 

Table:

id,name,price

1, Jon, 200

2, Atilla,400

3, Mario,600

4,Ronaldo,800

5,Pele,1200

6, Ronaldinho,1800

I want to create a table which needs to look like this:

 

Table:

id,name,price

1, Jon, 200

2, Atilla,400

3, Mario,600

4,Ronaldo,800

5,Pele,600

5,Pele,600

6, Ronaldinho,800

6, Ronaldinho,800

Is this possible in qlikview ?

Thanks in advance Const!

 

 

1 Solution

Accepted Solutions

Re: How to split the values into a column

not sure about it is optimize way do it. but you can try below

base_table:
Load * Inline [
id,name,price
1, Jon, 200
2, Atilla,400
3, Mario,600
4, Ronaldo,800
5, Pele,1200
6, Ronaldinho,1800
];

NoConcatenate
Temp:
Load IterNo() as rec,
*
While IterNo()<3;
Load
id,
name,
(price)/2 as price
Resident base_table
where price>=1000
;

Concatenate
Load 1 as rec,
id,
name,
price
Resident base_table
where price<1000
;
drop Table base_table;

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

4 Replies

Re: How to split the values into a column

on what basis you are dividing value also is it applicable for all rows or for specific row?
Great dreamer's dreams never fulfilled, they are always transcended.
constantin_olar
Contributor III

Re: How to split the values into a column

Hi , thanks for the reply back. Is only applicable only for the values which are 1600 and 1800. Basically I need to split the values on half.


@PrashantSangle wrote:
on what basis you are dividing value also is it applicable for all rows or for specific row?


 

constantin_olar
Contributor III

Re: How to split the values into a column

Hi , thanks for the reply back. Is only applicable only for the values which are 1600 and 1800. Basically I need to split the values on half.



 

Re: How to split the values into a column

not sure about it is optimize way do it. but you can try below

base_table:
Load * Inline [
id,name,price
1, Jon, 200
2, Atilla,400
3, Mario,600
4, Ronaldo,800
5, Pele,1200
6, Ronaldinho,1800
];

NoConcatenate
Temp:
Load IterNo() as rec,
*
While IterNo()<3;
Load
id,
name,
(price)/2 as price
Resident base_table
where price>=1000
;

Concatenate
Load 1 as rec,
id,
name,
price
Resident base_table
where price<1000
;
drop Table base_table;

Regards,
Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post