Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Simon_Kruizinga
Contributor II
Contributor II

Split values from one column into two different columns

Hi!

 

I have a table with data from two different energy meters listed in one column. I would like to split the column into two differtent columns. I cannot find any logic in the values. The table looks like this:

Date Time Meter
10-7-22 21:00 100
10-7-22 22:00 110
10-7-22 23:00 2100
11-7-22 00:00 2110
11-7-22 01:00 2115
11-7-22 02:00 115
11-7-22 03:00 2118
11-7-22 04:00 120

 

What I would like to achieve is a table that looks like this:

Date Time Meter_1 Meter_2
10-7-22 21:00 100 2100
10-7-22 22:00 110 2100
10-7-22 23:00 110 2100
11-7-22 00:00 110 2110
11-7-22 01:00 110 2115
11-7-22 02:00 115 2115
11-7-22 03:00 115 2118
11-7-22 04:00 120 2118

 

Thank you very much in advance!

Labels (3)
3 Replies
edwin
Master II
Master II

it is not obvious from your sample what the calculation of the 2nd column would be.

in general you would create a new table using the original table and create the 2nd column with the new table:

noconcatenate
Table2:
load Date, Time, Meter_1, Meter_1+something as Meter_2
resident Table1;

drop table Table1;

this way you derive the value of your 2nd column from your other column/columns.

sidhiq91
Specialist II
Specialist II

@Simon_Kruizinga It is not very clear on to how to derive meter1 and meter 2, if you could throw some light on it, it would help us understand and help you.

Simon_Kruizinga
Contributor II
Contributor II
Author

This is a sample of the raw data in a Google Sheet file:

Simon_Kruizinga_0-1657519657721.png

The values from two different meters are stored in the same column. I would like to split this into two different columns, one for each meter. So the meter with value 10773, 10774 ... has to be put in column with name meter_1 and the values 16103,16104 ... has to be put in another column with name meter_2.  Hopefully this makes it more clear for you