Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
tresesco
MVP
MVP

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
Author

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
Partner - Specialist
Partner - Specialist

What type of calculations you need to perform. ??

-Nilesh


Anonymous
Not applicable
Author

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
Author

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
Author

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
Author

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