Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mrthomasshelby
Contributor II

Exclude a Filter from affecting a particular chart

Hello,

I have a chart which has 2 measures as follows:

Measure 1:

if($(Vendor)=2, Count(distinct{<[NetValueinUSD]={"<=$(=$(vInput))"},[TypeOfContracting]={'Non Contracted'}>}[Vendor Name]),

if($(Vendor)=1,Count({<[NetValueinUSD]={"<=$(=$(vInput))"},[TypeOfContracting]={'Non Contracted'}>}[PurchDocument])))

Measure 2:

Sum({<[NetValueinUSD]={"<=$(=$(vInput))"},[TypeOfContracting]={'Non Contracted'}>}[NetValueinUSD])/1000000

Now I have a filter pane which has the field, TypeOfContracting, which has 2 values: Contracted and Non Contracted. If I select Contracted in this filter, my chart values are changing. But as you can see from above, I'm using only measures based on Non Contracted data. So, in short, my chart shouldn't display the data if Contracted is selected in the filter. If this is not possible I'd like to exclude this filter from affecting my chart at all. Can anyone help me fix this? TIA!

stalwar1

1 Solution

Accepted Solutions

Re: Exclude a Filter from affecting a particular chart

I have not looked at the sample, but make make this change

Sum({<Type *= {"N"}>}[Sales])

Read about this here:

Implicit Set Operators

16 Replies

Re: Exclude a Filter from affecting a particular chart

Hi,

Not sure but change your expression to below.

Count(distinct{<[NetValueinUSD]={"<=$(=$(vInput))"},[TypeOfContracting]={'Non Contracted'}>} if($(Vendor)=2,'[Vendor Name]','[PurchDocument]'))


Regards,

Kaushik Solanki

mrthomasshelby
Contributor II

Re: Exclude a Filter from affecting a particular chart

Hello. Let me explain this a bit. I have a chart which will measure Vendors or PurchDocuments(of non contracted type) according to the variable Vendor. That is measure 1. The expression is fine. What I'd like to do is stop the filter TypeOfContracting from affecting this chart. Because as you can see from the expression, I'm showing only Non Contracted count. Now it doesn't make sense if I selected Contracted from the TypeOfContracting filter and the chart gives some value.

Re: Exclude a Filter from affecting a particular chart

Can you tell us what value is hold by variable Vendor and Input?

Regards,

Kaushik Solanki

mrthomasshelby
Contributor II

Re: Exclude a Filter from affecting a particular chart

Vendor Variable is like a switch. It has values =1 or 2. The measure changes to Count by Vendor if Vendor Variable =1 or Count by PurchDocument if Vendor Variable=2. Input is a dynamic variable which can be input by the user.

Re: Exclude a Filter from affecting a particular chart

If possible, please share the application.

If not with actual data then dummy data which showcases your issue.

Regards,

Kaushik Solanki

mrthomasshelby
Contributor II

Re: Exclude a Filter from affecting a particular chart

Hello. PFA the qvf. Now as you can see, the filter Type if selected to C is affecting the chart. But as you can see from expressions, we are taking only counts for Type =N. So I'd like for the chart to be blank if C is selected in type. If this is not possible, prevent this filter from changing the chart at all. Thanks!

Re: Exclude a Filter from affecting a particular chart

Hi,

It is because of your dimension.

You have used the sum function in dimension but you have not filter it.

This include Sum({<Type={"N"}>}[Sales]) into your dimension and you will see it works.

Regards,

Kaushik Solanki

mrthomasshelby
Contributor II

Re: Exclude a Filter from affecting a particular chart

If I do this, when I select 'C' in Type filter, the chart stops changing. That is fine but is there any way where the chart goes blank if I select Type 'C' in the filter? I feel this makes more sense don't you think rather than the chart not changing?

Re: Exclude a Filter from affecting a particular chart

I have not looked at the sample, but make make this change

Sum({<Type *= {"N"}>}[Sales])

Read about this here:

Implicit Set Operators

Community Browser