Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

jbakerstull
Contributor

Assigning Values and adding them together

Good morning all,

What I'm trying to do is assign a value to field if it's selected.

What I achieved using formula below,.

=if(Match(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Nancy''s Place'),39)

Now if I select multiple fields, I want to add two values together that I assigned but the value shows up as zero.

=if(Match(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Nancy''s Place'),39,

if(Match(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Faith on 6th'),89))

I also tried this formula (created by sunny). The formula below disregards the selections made. It just adds the values.

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

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


I also tried this formula but sum add up to 23,585 (?).

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


1 Solution

Accepted Solutions
jbakerstull
Contributor

Re: Assigning Values and adding them together

Are you sure, you have these * in place?  - Yes,

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

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


This formula worked:
RangeSum(

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Nancy''s Place') > 0,39),

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Faith on 6th') > 0, 89)

)

3 Replies

Re: Assigning Values and adding them together

Are you sure, you have these * in place?

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

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

You can try this

RangeSum(

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Nancy''s Place') > 0,39),

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Faith on 6th') > 0, 89)

)

jbakerstull
Contributor

Re: Assigning Values and adding them together

Are you sure, you have these * in place?  - Yes,

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

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


This formula worked:
RangeSum(

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Nancy''s Place') > 0,39),

if(SubStringCount(GetFieldSelections([Entry Exit Provider Name]),'LSS - FM Faith on 6th') > 0, 89)

)

jbakerstull
Contributor

Re: Assigning Values and adding them together

Thank you (again for you time and help)

Community Browser