Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Add a calculated column

I need to add a calculated column i.e. I have 4 columns in my existing data, once this data is uploaded in Qlikview I need to add a calculated column (calculation will be based on 2 existing columns) which will be my 5th column in my dataset. This new column will be used in different char/graphs. How can I achieve this?

7 Replies
MVP
MVP

Re: Add a calculated column

To be able to use the same calculated field in different charts, calculate it in the script like:

Load

          FieldA,

          FieldB,

          FieldA*100+FieldB AS calculatedField

from <>;


Not applicable

Re: Add a calculated column

Hi,

When you load your table you can add fields as you like.

For example, if you are loading the following table:

Load A,

        B

FROM File;

You are able to do something like this:

Load A,

        B,

        A + B as C,

        A - B as D

FROM File;

Regards.

nilesh_gangurde
Valued Contributor

Re: Add a calculated column

What type of calculations you need to perform. ??

-Nilesh


neetha_p
Honored Contributor

Re: Add a calculated column

Hi Abhinav,

1.You can create column by creating a field(Result of Calculated two columns) in load script.

and select the create field in chart.

2.Create a expression in Expression tab of a chart

Not applicable

Re: Add a calculated column

Thank guys but is there a possibility of doing the same without using script? I mean, using some option in Qlikview after loading the data.

Not applicable

Re: Add a calculated column

Yes using expressions as Nitha says, in my example you can do a expression as sum(A) + sum(B) or sum(A + B) depending of you want.

Not applicable

Re: Add a calculated column

try:

Table2:

LOAD

IDKey,

sum(data1) as Data1Sum,

sum(data2) as Data2Sum

Resident Table1;

LEFT JOIN (Table2)

LOAD

IDKey,

Data1Sum-Data2Sum as DifferenceSum

Resident Table2;

Is this what you are looking for?

Thanks,

Angad

Community Browser