Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Filter on an IF-Statement

I have a table whit the lost, new and enduring customers. This table shows the name of the customer and whether this is a new customer (new) is an existing customer (=) or that we have lost this customer (lost). If there is a record for the current year in the database it means that turnover has been booked and that the customer is active this year. The same applies for last year. Based on this information, we know what the status of the customer is and I have processed this in the following (simple) function:

=IF(

MIN(PeriodeJaar)= vCurrentYear,'New',

(IF(

MAX(PeriodeJaar)=((vCurrentYear)-1),'Lost',

'=')))

SO, now I know of the customer is a new, lost or enduring customer. I would only like to be able to filter the status, for example: I only want to see the lost customers. Then I choose 'Lost' in a filter. This sounds simple, but i don't know how. Maybe because this is an calculating value that makes it difficult?

Something like the picture below: If i select 'lost' in the filter than the data in the chart will be filtered and show only the lost customers. Is that possible?

QV_Question.PNG

1 Reply
marcus_sommer

You need to create a dimension to be able to filter their results - maybe with something like this:

aggr(

IF(

MIN(PeriodeJaar)= vCurrentYear,'New',

(IF(

MAX(PeriodeJaar)=((vCurrentYear)-1),'Lost',

'=')))

, OrganisatieNm)

More to the logic could you find here: Calculated Dimensions.

- Marcus