QlikView - Fill Function


Advertisements

The Fill function in QlikView is used to fill values from existing fields into a new field.

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,
May,1245,
June,5124,3652
July,7421,7514
August,2584,
September,5314,4251
October,7846,6354
November,6532,7451
December,4625,1424
January,8547,7852
February,3265,

Load Script

The above data is loaded to the 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.

1_fill_choose_file

After clicking Next in the above step, we choose the Enable Transformation Step button to carry out the required data transformation.

2_fill_file_wizard

Selecting the Data Transformation

As we are going to use the Fill function, let us choose the Fill tab, which displays th empty values under the Actual Field.

3_fill_transformation

Create the Fill Condition

On clicking the Fill button, the option to choose target column and the cell condition appears. We choose column three, as we want to fill the empty values of this column with values from same row in column two. Also, choose the Cell Value as empty so that only the empty cells will be overwritten with new values.

4_fill_cell_condition

Transformed Data

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

5_fill_filled_cells

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 replaces the empty cell values.

6_fill_laod_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.

7_fill_table_box
Advertisements