# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## Conditional sum in Qliksense

Hello,

I am trying to do a conditional sum in Qliksense.

I have used the below two methods but none of them work.

1) First way:

SUM([Grade Value] * (credit_hours)) / Sum(credit_hours))

2) Second way:

Sum(

SUM([Grade Value] * (credit_hours)) / Sum(credit_hours)

)

What I basically need is that only the grades that I have selected above be used in calculation of GPA.

Let me know if anyone have come across this problem.

BR,

Vipin Saroha

Tags (3)
1 Solution

Accepted Solutions
MVP

## Re: Conditional sum in Qliksense

Hi,

Try like this

Hope this helps you.

Regards,

jagan.

6 Replies
Valued Contributor III

## Re: Conditional sum in Qliksense

Hi VIPIN,

You can try to use set analysis, like the below:

Hope this helps.

MVP

## Re: Conditional sum in Qliksense

In this solution:

SUM([Grade Value] * (credit_hours)) / Sum(credit_hours))

you will need OR after each value

SUM([Grade Value] * (credit_hours)) / Sum(credit_hours))

Sinan solution is the way to go as IF will increase the calculation time but you can use IF in this form

Not applicable

## Re: Conditional sum in Qliksense

Hello Sinan,

Thank you for this, the set analysis works fine.

The problem arises when there is only one selection available, at that time it does not show updated info.

See the image attached, in this selection the GPA Gauge should show 4, but it gets stuck with the last value.

Let me know if you can help.

Not applicable

## Re: Conditional sum in Qliksense

Hello Robert,

I tried bot the suggestions that you have mentioned, using OR as well as Match function.

But none of them work correctly, they do not show any data.

Could you suggest something else?

Complete formula with OR:

SUM([Grade Value] * (credit_hours)) / Sum(credit_hours))

MVP

MVP

Hi,

Try like this