Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Adding multiple columns

How do you go about adding multiple columns together? Could someone give me a working example of an expression they've used?

Tags (1)
6 Replies
eduardo_sommer
Valued Contributor

Re: Adding multiple columns

Hi Henry

Could you please give more details about your problem?

Eduardo

Not applicable

Re: Adding multiple columns

Hi Eduardo

For example

=Sum([Sales-Value(£)]-[Purchases-Value(£)])

Here the first value is the price received from a sales, the second is the purchase price. I want to work out the profit or loss. Does this look right? The values that I'm getting back I know are wrong. I've only recently started using Qlik so not very familiar with expressions.

Thanks

Henry

paul_scotchford
Valued Contributor

Re: Adding multiple columns

Do you mean summing 2 or more columns in the model either at load or expression , if so then

use RangeSum() e.g. RangeSum(2,3,4,6) = 15 or RangeSum(Col1,Col2,Col3) etc plenty of content in the Help

cheers

Paul

Not applicable

Re: Adding multiple columns

using & symbol to connect?

paul_scotchford
Valued Contributor

Re: Adding multiple columns

I have never put a symbol in the field name like you have done.

    sum(SalesValue) - sum(PurchaseValue)

    Calculate profit in your Loader rather than on the fly as this will impede performance on a large data set on your

    sheet

    More often than not , you source data will probably have pre calculated profit.

Re: Adding multiple columns

So you mean like in QV where you can add more fields to a table before the table is created?

That not available at the moment.