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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
jbakerstull
Creator
Creator

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
Creator
Creator
Author

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.

View solution in original post

12 Replies
sunny_talwar

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
Creator II
Creator II

=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
Creator
Creator
Author

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



sunny_talwar

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
Creator
Creator
Author

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
Creator
Creator
Author

To bad there wasn't a very helpful option.

sunny_talwar

Super

sunny_talwar

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
Creator
Creator
Author

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