Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Eshwar1
Contributor III
Contributor III

Show Line Chart Based on Table Row Selection with Fallback to Default Leader – Using Alternate States and Containers

Hi Qlik Community,

I’m working on a Qlik Sense application with a scenario involving alternate states, containers, and conditional display logic for a line chart based on a table row selection. Below is the full setup and requirement:

Current Setup

  1. Container 1 (Default State):
    • Contains a Table Chart.
    • The Table Chart is set to "Inherited" state, meaning it uses the Default State of the container.
  2. Container 2 (Alternate State: "Quality Table Selections"):
    • Contains a Line Chart.
    • The Line Chart is also set to "Inherited", so it uses the container’s alternate state "Quality Table Selections".

Objective

  • I have a table chart displaying leaders across L2, L3, and L4 levels.

  • I also have a line chart that displays P0 defect trends for the selected leader.

  • If a leader is selected from the table, the line chart should show the trend for that leader.

  • However, if I apply any filter (like priority) and the selected leader is no longer visible in the table due to that filter (i.e., no associated data), then the line chart should fallback and show data for a default leader: "Adam krish"

Goal:

I want to evaluate whether the user has selected a leader from the table and whether that selected leader has any associated data after applying filters.

If valid selection with data: show that leader’s trend.

If no leader selected or no data found: show trend for "Adam krish" instead.

 

line chart container show condition expression

=if({[Quality Table Selections]} l2_devmanager_manager_name >0, 1,0)

 
Line chart expression:
//P0
if( GetSelectedCount(l2_devmanager_manager_name)>0 AND GetSelectedCount(l3_devmanager_manager_name)=0 AND GetSelectedCount(l4_devmanager_manager_name)=0,
sum({[$]<[l2_devmanager_manager_name] = [Quality Table Selections]::[l2_devmanager_manager_name],l3_devmanager_manager_name-={'*'},l4_devmanager_manager_name-={'*'}>}quality_trends.p0_count),

if( GetSelectedCount(l2_devmanager_manager_name)>0 AND GetSelectedCount(l3_devmanager_manager_name)>0 AND GetSelectedCount(l4_devmanager_manager_name)=0,
sum({[$]<[l3_devmanager_manager_name] = [Quality Table Selections]::[l3_devmanager_manager_name],l4_devmanager_manager_name-={'*'}>}quality_trends.p0_count),
if(GetSelectedCount(l2_devmanager_manager_name)>0 AND GetSelectedCount(l3_devmanager_manager_name)>0 AND GetSelectedCount(l4_devmanager_manager_name)>0,
sum({[$]<[l4_devmanager_manager_name] = [Quality Table Selections]::[l4_devmanager_manager_name]>}quality_trends.p0_count)))
)
 
Line chart Show measure if Conditon:
 
If(concat({$} distinct quality_metric, ',') LIKE '*P0*'  OR only({[$]} quality_metric) ='All', 1,0)
 
Line chart Title expression:
 
=If(isnull(GetFieldSelections(l3_devmanager_manager_name)) AND isnull(GetFieldSelections(l4_devmanager_manager_name)), GetFieldSelections(l2_devmanager_manager_name) & ' - Defects',

 If(isnull(GetFieldSelections(l4_devmanager_manager_name)), GetFieldSelections(l3_devmanager_manager_name) & ' - Defects',

 

Can you suggest the solution to get desired result.

Thanks in Advance

Eshwar

 

 

 

 

Labels (3)
1 Reply
Eshwar1
Contributor III
Contributor III
Author

Can anyone provide the solution for this issue.

Thanks in advance!