Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jbakerstull
Contributor

If statement adding values

I'm trying to add to values together based on selections made from [Entry Exit Provider Name].


If I just select 'LSS - FM Faith on 6th' the value returns 89.


If I select 'LSS - FM Faith on 6th'  and 'LSS - FM Nancy''s Place', the return value is 27K.


I expected the value to be 128. Need some help.

Formula

=Sum(If(Match([Entry Exit Provider Name],'LSS - FM Faith on 6th'),89,

If(Match([Entry Exit Provider Name],'LSS - FM Nancy''s Place'),39,0)))

Thanks

1 Solution

Accepted Solutions
jbakerstull
Contributor

Re: If statement adding values

I just released that the formula is ignoring the programs that are selected in the  [Entry Exit Provider Name]  object.

What the formula is doing is adding all program values together. I just realized this after adding 72 additional programs to the formula.

12 Replies

Re: If statement adding values

May be try this

=Sum({<[Entry Exit Provider Name] * = {'LSS - FM Faith on 6th'}>} 89) + Sum({<[Entry Exit Provider Name] * = {'LSS - FM Nancy''s Place'}>} 39)

rangam_s
Contributor II

Re: If statement adding values

=Sum(If(Match([Entry Exit Provider Name],'LSS - FM Faith on 6th'),89,

If(Match([Entry Exit Provider Name],'LSS - FM Nancy''s Place'),39,0)))

In the second if condition you have two single quote with in the data, so you need to protect those single quote to read correctly.

=Sum(If(Match([Entry Exit Provider Name],'LSS - FM Faith on 6th'),89,


If(Match([Entry Exit Provider Name],'LSS - FM Nancy''''s Place'),39,0)))

jbakerstull
Contributor

Re: If statement adding values

Sunny, the formula has an error

=Sum({<[Entry Exit Provider Name] * = {'LSS - FM Faith on 6th'}>} 89) + Sum({<[Entry Exit Provider Name] * = {'LSS - FM Nancy''s Place'}>} 39)


Rangam, the sum adds up to 23,585 using formula

=Sum(If(Match([Entry Exit Provider Name],'LSS - FM Faith on 6th'),89,


If(Match([Entry Exit Provider Name],'LSS - FM Nancy''''s Place'),39,0)))



Re: If statement adding values

How about this

=RangeSum(

Avg({<[Entry Exit Provider Name] *= {'LSS - FM Faith on 6th'}>} 89),

Avg({<[Entry Exit Provider Name] *= {'LSS - FM Nancy''s Place'}>} 39))

jbakerstull
Contributor

Re: If statement adding values

that worked

RangeSum(

Avg({<[Entry Exit Provider Name] *= {'LSS - FM Faith on 6th'}>} 89),

Avg({<[Entry Exit Provider Name] *= {'LSS - FM Nancy''s Place'}>} 39))

thank you!

jbakerstull
Contributor

Re: If statement adding values

To bad there wasn't a very helpful option.

Re: If statement adding values

Super

Re: If statement adding values

We can def. create an if statement also... but set analysis is better than if statement... do you really want to use if statement?

jbakerstull
Contributor

Re: If statement adding values

I believe the set analysis will be more flexible. Can conditions be added to it?

Community Browser