Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Amzngwarrior
Contributor II
Contributor II

Getfieldsections

Hello

I'm new in Qlik Sense. I have a field with an object type consisting of three values. I am making a kpi and I want that when the filter of an object is selected, the proportion is considered only within the framework of this type. It works with one type, but when you select two values it doesn't work.

 

=Sum([Sales])/IF(GetFieldSelections([Type])='Milk', sum(18000),

IF(GetFieldSelections([Type])='Water', sum(25000),
IF(GetFieldSelections([Type])='Meat', sum(105),
IF(GetFieldSelections([Type])='Milk' and GetFieldSelections([Type])=''Water', sum(43000),
IF(GetFieldSelections([Type])='Milk' and GetFieldSelections([Type])='Meat', sum(18105),
IF(GetFieldSelections([Type])='Meat' and GetFieldSelections([Type])='Water', sum(25105), SUM(43105)))))))

1 Solution

Accepted Solutions
Or
MVP
MVP

e.g.

WildMatch(GetFieldSelections([Type]),'*Milk*) 

should work, I think. I might have the two parameters in the wrong order...

View solution in original post

4 Replies
Or
MVP
MVP

GetFieldSelections() gives you the field selections, concatenated, as stated in the official help site..

https://help.qlik.com/en-US/qlikview/April2020/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

You can use Match() or WildMatch() to match your string to the concatenated selection, instead of trying a direct comparison like you did.

 

Amzngwarrior
Contributor II
Contributor II
Author

Thank you for answers, I'll try to figure it out, but don't know the syntax yet

Or
MVP
MVP

e.g.

WildMatch(GetFieldSelections([Type]),'*Milk*) 

should work, I think. I might have the two parameters in the wrong order...

Amzngwarrior
Contributor II
Contributor II
Author

Thank you!