Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Adamo
Contributor III
Contributor III

Measure if dimension match value

I am trying to produce a Measure that only Sum Sales whenever  Measure1 does not start with 'Otros' but the problem this set analysis funcitions produces no value.

=if(NOT(Wildmatch(Measure1, 'Otros*')),Sum(Sales))

I cannot use the following one, because then when I select on a App Filter any Value on Meausure 1, then it shows values for the whole values of Measure1 although I need to match with the App filter.

 

Sum ({<Measure1=-{'Otros*'}>} Sales)  or Sum ({<Measure1=-{"Otros*"}>} Sales)  

If I select Value1 for Measure1 on the App filter, then the above formula will show sum(sales) for Value1 and a all values except the ones that start with "Otros*".

What I need is that If I select value1 on Measure1 App Filter, it will only show Sum(Sales) for Value1.

I was able to produce that result if there is a Dimension on a table, but not in a Kpi.

For example:

Dimension

=if(NOT(Wildmatch(Measure1, 'Otros*')),Date)

Measure

=Sum(Sales)

How I can produce that result in a KPI?

I was trying something like =if(NOT(Wildmatch(Measure1, 'Otros*')),Sum(Sales)) but I didn´t produce any result is just "0"

Labels (1)
5 Replies
y_grynechko
Creator III
Creator III

Hey,

try this:

Sum ({<Measure1=-{"Otros*"}>} Sales)

Adamo
Contributor III
Contributor III
Author

As I said I cannot use that one.

Sum ({<Measure1=-{'Otros*'}>} Sales) 

Becasuse I need to use Measure1 on App Filters

y_grynechko
Creator III
Creator III

Create additional field in the load script: If(Measure1 like 'Otros*', 1, 0) as Exclude

use this measure: Sum ({<Exclude={'0'}>} Sales)

Adamo
Contributor III
Contributor III
Author

Yess that probably works, but I was looking for a SET ANALYSIS solution, if that's posible.

y_grynechko
Creator III
Creator III

if(GetSelectedCount(Measure1) > 0, Sum(Sales), Sum({<Measure1=-{"Otros*"}>} Sales))