# QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

## set analysis with if

hello

i have a field with values greater and less than 0.

so, i need to make a set analysis where if the value of A is greater than 0 is sum with a field B, and if it's less than 0 is sum with a field C.

Thanks.

Tags (1)
2 Replies
MVP

## Re: set analysis with if

No need for an if statement:

Sum({<A = {">0"}>} B) + Sum({<A = {"<0"}>} C)

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable

## Re: set analysis with if

You don't seem to ask a question in your post, but based on the subject I assume you want to know how to do a conditional sum?

Set analysis limits (or extends) the set of data the formula is working on, so that's not the way to go here. If is the function you want:

`=SUM(IF(FieldA>0,FieldB,FieldC))`

This wil check the value of Field A for each record and if it is greater than 0 it will add FieldB to the total sum, else Field C