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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
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?

6 Replies
eduardo_sommer
Partner - Specialist
Partner - Specialist

Hi Henry

Could you please give more details about your problem?

Eduardo

Not applicable
Author

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

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
Author

using & symbol to connect?

paul_scotchford
Specialist
Specialist

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.

robert_mika
MVP
MVP

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.