Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
asheppardwork
Creator
Creator

VizLib Line Chart Filter Fix in Qlik Sense

I have a VizLib Line Chart Filter Fix in Qlik Sense November 2023 Patch 10.  I have a chart that is made of 1 measure (Amount) and 2 Dimensions (Name and Date.autoCalendar.MonthYear).  This chart is on a dashboard with several other fields/tables etc. that have other versions of this date field.  Some are plain Date, some are 'Month' and 'Year' that come from the Load statement of that field as a Month or Year number.  I need to be able to have the field selection filtering only filter this chart if Name is selected and to ignore everything else.  The reason is so that the chart will always show the full set of dates and amounts but only the Names that are wanted. The problem is not matter what formula or set analysis I apply I only get 1 of 3 results. 

1)Nothing filters

2)'Some' of the rows get filtered when dates are filtered and other filters still work 100%.

3) Everything filters and there is no effect of trying to block the filtration

I have tried the following with the results above:

Measure set:

1) Sum({1<Date=>}Amount)

or NUM(Sum(Date=>}Amount), '$#,##0.0', '.', ',')   ----- nothing filters with these

2) Sum({1<Address1=,Address2=,... all the other fields ...,Name=P(Name)>}Amount) ---- some things filter even if they are in the list of = fields and dates still affect some of the rows; so that if a record doesn't have a date in a given filter it doesn't show up.

3) Sum({<Date=,Name=P(Name)>}Amount) --- all filters work with this dates, names, address, etc.

I need to get this to filter only on Name, and no other field, is this even possible?

Labels (2)
1 Solution

Accepted Solutions
goncalo_ricardo_pereira
Partner - Contributor III
Partner - Contributor III

Hi @asheppardwork ,

I believe your issue might be in the P() function. Basically, the P() and E() functions also allow set analysis and probably what is happening is... When you have the following expression

Sum({1<Address1=,Address2=,... all the other fields ...,Name=P(Name)>}Amount)

You are ignoring the filter in the fields Address1,Address2 and others, nevertheless, this condition is only applied to the Sum expression... Considering that you also using in the set analysis the P() function, you should probably do the following or something similar:

Sum({1<Address1=,Address2=,... all the other fields ...,Name=P({1}Name)>}Amount)

or

Sum({<Address1=,Address2=,... all the other fields ...,Name=P({<Address1=,Address2=,... all the other fields>}Name)>}Amount)

 

The following post explains very well the P() and E() logic in Qlik.

https://community.qlik.com/t5/QlikView-App-Dev/P-E-and-where-do-you-use-them/td-p/457847

View solution in original post

3 Replies
goncalo_ricardo_pereira
Partner - Contributor III
Partner - Contributor III

Hi @asheppardwork ,

I believe your issue might be in the P() function. Basically, the P() and E() functions also allow set analysis and probably what is happening is... When you have the following expression

Sum({1<Address1=,Address2=,... all the other fields ...,Name=P(Name)>}Amount)

You are ignoring the filter in the fields Address1,Address2 and others, nevertheless, this condition is only applied to the Sum expression... Considering that you also using in the set analysis the P() function, you should probably do the following or something similar:

Sum({1<Address1=,Address2=,... all the other fields ...,Name=P({1}Name)>}Amount)

or

Sum({<Address1=,Address2=,... all the other fields ...,Name=P({<Address1=,Address2=,... all the other fields>}Name)>}Amount)

 

The following post explains very well the P() and E() logic in Qlik.

https://community.qlik.com/t5/QlikView-App-Dev/P-E-and-where-do-you-use-them/td-p/457847

asheppardwork
Creator
Creator
Author

Thank you sir, neither option is working like I need it;

=Sum({1<ADDRESS1=,ADDRESS2=,...all the other fields...,NAME=P({1}NAME)>}AMOUNT)

doesn't respond to any filtration while 

=Sum({<ADDRESS1=,ADDRESS2=,...all other fields...,NAME=P({<ADDRESS1=,ADDRESS2=,...all other fields...>}NAME)>}AMOUNT)

responds only to date filtration; am I doing something wrong?

asheppardwork
Creator
Creator
Author

So, thanks everyone for your help on my issue with Qlik and filters and charts; it was my human error.  The filter of the field 'Name' was working as Qlik intended; and I was displaying another field. So once I got my head on straight and used the correct display field and the correct field in the set analysis logic; it worked.  So the moral of the story; always check on your own assumptions.