QlikView - Column Manipulation



Column Manipulation is a type of Data Transformation in which a new column is populated with values from an existing column, which meets certain criteria. The criteria can be an expression, which is created as part of the Data Transformation step.

Input Data

Let us consider the following input data, which represents the actual and forecasted sales figures.

Month,Forecast,Actual
March,2145,2247
April,2458,2125
May,1245,2320
June,5124,3652
July,7421,7514
August,2584,3110
September,5314,4251
October,7846,6354
November,6532,7451
December,4625,1424
January,8547,7852
February,3265,2916

Load Script

The above data is loaded to QlikView memory by using the script editor. Open the Script editor from the File menu or press Control+E. Choose the "Table Files" option from the "Data from Files" tab and browse for the file containing the above data. After clicking Next, we choose the Enable Transformation Step button to carry out the required data transformation.

1_cm_file_wizard

Selecting the Data Transformation

Choose the Column tab and then choose the New button. It asks to specify the New column and the Row Condition. We specify column 3 as the source column and pick the values, which start with two as the Row Condition.

2_cm_add_column

Transformed Data

On completing the above steps, we get the transformed data as shown below.

3_cm_added_column

Load Script for Transformed Data

The load script for the Transformed data can be seen using the script editor. The script shows the expression, which creates the new column with required values.

4_cm_file_wizard_script

Display Transformed Data

The transformed data can be seen by creating a Table Box using the option in the menu Layout → New Sheet Object.

5_cm_completed
Advertisements