Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Flxvio043
Contributor III
Contributor III

Ignore Filter in Gantt Chart Dimension

Hello everyone, I'm working with Qlik Sense and currently trying to ignore a filter. I have created a Gantt chart that should include the reference countries EU, USA, and Switzerland. However, I also have a filter for sub-region. Since EU, USA, and Switzerland belong to Global and not to other regions like Asia-Pacific or MEA, nothing is displayed when I filter, for example, by MEA. However, I would like the sub-region filter to be ignored for this Gantt chart so that EU, USA, and Switzerland are always present regardless of which region is filtered. I suspect that I can do this in the dimension of the Gantt chart. Unfortunately, I haven't been able to do it yet. Here is my code and what the Gantt chart looks like.

This is the Dimension Code. Problem here if filtered for Sub-Region this "Countries" are not in the filtered list so nothing is available

Flxvio043_1-1679320794792.png

This is how it looks like' when not selecting any sub-region (This is how it should look like also when filterd by sub-region)

Flxvio043_0-1679320724847.png

 

Please help me to ignor the filter

 

Thank you very much and best regards

Labels (6)
7 Replies
Or
MVP
MVP

Typically you would handle this by modifying the measure, not the dimension, using set analysis, e.g.

Sum({< Region = , Country = {'EU','USA','Switzerland'} >} SomeField)

You could do this with a dimension but you would still need to modify the measure(s) to match, e.g.

=Aggr(Only({< Region = >} if(Country ='EU' or Country = 'USA',Country )),Country )

Flxvio043
Contributor III
Contributor III
Author

Hi @Or ,

 

Thank you very much for your answer. Sorry than i was wrong with the dimension.

I will share you below my code for the measures. Maybe you can help me to fullfill the ignor filter. Thank you

So this is the Code for the Start Date :

if(Country='Switzerland' or Country='USA' or Country='EU', if([Actual Submission Date]<>'', [Actual Submission Date], if(GetFieldSelections(Case)='Best Case', [Target Submission Date (Best Case)], [Target Submission Date (Standard Case)])), min([Actual Submission Date]))

 

And this is the code for the End Date

if(Country='Switzerland' or Country='USA' or Country='EU', if([Actual Submission Date]<>'', [Actual Submission Date], if(GetFieldSelections(Case)='Best Case', [Target Submission Date (Best Case)], [Target Submission Date (Standard Case)])), min([Actual Submission Date]))

 

This is all code that I have and for dimension i did not change anything yet. 

Best Regards

Or
MVP
MVP

You would need to wrap the fields in an Only() function (which is implicit anyway, so it doesn't change anything), excluding the one that already has a min(), and add the relevant set to each one of those functions.

Flxvio043
Contributor III
Contributor III
Author

Thanks for this answer. I realy tried now a lot and putted all the fields to Only() function. Unfortunately it did not work. What am I doing wrong:

Dimension

=Aggr(Only({< Sub-Region = >} if(Country ='EU' or Country = 'USA' or Country= 'Switzerland',Country )),Country )

Start Date:
if(Country='Switzerland' or Country='USA' or Country='EU', if([Actual Submission Date]<>'', Only([Actual Submission Date]), if(GetFieldSelections(Case)='Best Case', Only([Target Submission Date (Best Case)]), Only([Target Submission Date (Standard Case)]))), min([Actual Submission Date]))

End Date

if(Country='Switzerland' or Country='USA' or Country='EU', if([Actual Submission Date]<>'', Only([Actual Submission Date]), if(GetFieldSelections(Case)='Best Case', Only([Target Submission Date (Best Case)]), Only([Target Submission Date (Standard Case)]))), min([Actual Submission Date]))

Or
MVP
MVP

None of those if() statements against the country in the dates should be there. Those should be sets within the Only() functions. It might also be necessary to wrap the whole thing up in an aggr() with the set - hard to say without knowing what the exact data structure is.

As a rule of thumb, if possible, you should write any if() statements within the aggregation function, rather than externally of it. Refactoring your code to do that should make it easier to get the whole thing working.

Flxvio043
Contributor III
Contributor III
Author

hi @Or ,

 

I'm sorry to contact you again...

I tried now for 3 Houres straight and I don't get it. I don't know what I'm doing wrong or whey it not works. I just startet with Qliksense 3 weeks ago and I think my knowledge is to small. Maybe you can help me again.

So here I will show you a simple example of how my data look like:

Flxvio043_0-1679387291488.png

You can See Country is connected in the line with the Sub Region. Switzerland in this Example is in Global and not in Asia Pacific. If I now filter in the Qliksense for Asia Pacific, Switzerland is of course not selected. The problem is, in this gantt chart, this Sub- Region Filter needs to be ignored. So if i fiter for Asia Pacific Switzerland will still be shown. 

I tried to change the code as you said with only and aggr() functions but there is something wrong:

 

Start Date:

aggr(
if(
Country='Switzerland' or Country='USA' or Country='EU',
only(
if(
[Actual Submission Date]<>'',
[Actual Submission Date],
if(
GetFieldSelections(Case)='Best Case',
[Target Submission Date (Best Case)],
[Target Submission Date (Standard Case)]
)
)
),
min([Actual Submission Date])
),
)

End Date:

aggr(
if(
Country='Switzerland' or Country='EU' or Country='USA',
only(
if(
[Actual Approval Date]<>'',
[Actual Approval Date],
if(
GetFieldSelections(Case)='Best Case',
[Target Approval Date (Best Case)],
[Target Approval Date (Standard Case)]
)
)
),
min([Actual Approval Date])
),

)

 

For the Dimension I used what you provided me:

=Aggr(Only({< Region = >} if(Country ='EU' or Country = 'USA',Country )),Country )

 

I really don't know what else to try. If possible please help me with this.

Best regards

 

 

Or
MVP
MVP

I've done my best to assist here, but as I said, with formulas like this is gets tricky to isolate the right conditions and sets in the right places. In the general sense, you need to ensure that the dataset being worked on includes the information you want, and that means any condition written using an if() statement needs to happen *after* you've defined the relevant set.

You should also not need to write the Country='Switzerland' or Country='USA' or Country='EU' statement because, as per your original post, you only want data for these countries (regardless of what has been filtered). This should fall under the set {< Region = , Country = {'EU','USA','Switzerland'} >}