Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
wanyunyang
Creator III
Creator III

two KPIs with same filter

I have two KPIs, KPI1 is using year1, KPI2 is using year2. I'm trying to create a filter called year, which for KPI1 is year1, for KPI2 is year2. Is that possible?

Thanks for help.

1 Solution

Accepted Solutions
jwjackso
Specialist III
Specialist III

I like to use the P() function.  In the example below,

KPI1 is calculated by =Sum({$<Year1=P(Year)>}Val)

and

KPI2 is calculated by Sum({$<Year2=P(Year)>}Amt)

PFunction.PNG

this is the data I used:

Data:

Load * Inline [

Year

2018

2017

2016

];

Data1:

Load * Inline [

D1,Year1,Val

A,2018,100

B,2017,200

];

Data2:

Load * Inline [

D2,Year2,Amt

C,2017,300

D,2016,400

];

View solution in original post

2 Replies
jwjackso
Specialist III
Specialist III

I like to use the P() function.  In the example below,

KPI1 is calculated by =Sum({$<Year1=P(Year)>}Val)

and

KPI2 is calculated by Sum({$<Year2=P(Year)>}Amt)

PFunction.PNG

this is the data I used:

Data:

Load * Inline [

Year

2018

2017

2016

];

Data1:

Load * Inline [

D1,Year1,Val

A,2018,100

B,2017,200

];

Data2:

Load * Inline [

D2,Year2,Amt

C,2017,300

D,2016,400

];

pawwy1415
Creator III
Creator III

Hi,

Try with alternate states.

Please find the attached sample app here replace Date with Year.