# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Contributor

## Replicate IF(SUM(fieldA)>0, SUM(fieldB)) with set analysis

Hi everyone,

Sorry if this is repeated question, but I couldn't find a related topic and would appreciate any help with this one.

So I got a table looking like following

```T:
Load * inline [
date, agent, type, goal, act
01.01.2019, A, 1,, 120
01.01.2019, A, 2, 100,
02.01.2019,	A, 1,,150
02.01.2019, A, 2,,90
01.01.2019, B, 1,, 0
01.01.2019, B, 2, 120
02.01.2019, B, 1,, 0
02.01.2019, B, 2, 140
];```

The ultimate goal is to create a bar chart:

dimension=agent

measure1=sum(act)

measure2=sum(goal)

But to show only those agents, which have their sum(act)>0.

(Thus the chart will not show agent=B)

The basic solution I could find is to turn off zero values in chart settings and modify:

measure2=IF(SUM(act)>0, SUM(foal))

But can the same effect be achieved by set analysis (to get rid of IF clause)?

Labels (1)
• ### Set Analisys

1 Solution

Accepted Solutions MVP

## Re: Replicate IF(SUM(fieldA)>0, SUM(fieldB)) with set analysis

Try this

`Sum({<agent={"=Sum(act)>0"}>}goal)`
2 Replies MVP

## Re: Replicate IF(SUM(fieldA)>0, SUM(fieldB)) with set analysis

Try this

`Sum({<agent={"=Sum(act)>0"}>}goal)`
Contributor

## Re: Replicate IF(SUM(fieldA)>0, SUM(fieldB)) with set analysis

Thanks!
Works as intended 🙂