Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
mrthomasshelby
Creator III
Creator III

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
sunny_talwar

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

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

Read about this here:

Implicit Set Operators

View solution in original post

16 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
mrthomasshelby
Creator III
Creator III
Author

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.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
mrthomasshelby
Creator III
Creator III
Author

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.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

If possible, please share the application.

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

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
mrthomasshelby
Creator III
Creator III
Author

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!

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
mrthomasshelby
Creator III
Creator III
Author

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?

sunny_talwar

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

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

Read about this here:

Implicit Set Operators