Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Mahamed_Qlik
Specialist
Specialist

Link between two objects from different application

Dear all,

We have an requirement to create mashup page to display different objects from 2 different application.

In below picture,  both the charts are from different application and they have separate year and month filter in application.

we need to create two filter with the name Year and Month that should be linked to respective application Year ,Month dimensions.

so if user select year then both the charts should use there respective year/month dimension and this needs to applied in the chart values.

 

Mahamed_Qlik_0-1689146674893.png

 

Kindly assist in writing mashup script.

 

Labels (1)
3 Replies
joaopaulo_delco
Partner - Creator III
Partner - Creator III

Hi @Mahamed_Qlik !

              I think it will be easier for you to build a new app with information of these two applications working with these date filters before you start doing a mashup.

Help users find answers! Don't forget to mark a solution that worked for you!
Mahamed_Qlik
Specialist
Specialist
Author

Hi Joaopaulo,

Thanks for the advise but this is just example we have very big dashboard both of them so can create new and one more separate application. so we have decided to go for mashup instead.

Thank you

Mahamed_Qlik
Specialist
Specialist
Author

This is my jd code :

My dimension name from both apps is "MonthName". Do I need to put this name anywhere in below code or what I am missing?

var selState = app.selectionState( );
var listener = function() {
 
app2.clearAll();
    var selFields = selState.selections;
var cacheString="";
 
if (selFields!=null){
$.each(selFields, function(key, value) {
var valArray=[];
$.each(value.selectedValues, function(key,value){
valArray.push(value.qName);
})
cacheString=cacheString + '@' + value.fieldName +"~" + value.qSelected;
app2.field(value.fieldName).selectValues(valArray);
 
 
});
localStorage.setItem("QlikFilter",cacheString);
}
 
  };
  selState.OnData.bind( listener );
 
 
 
 
 
retrieveSelectionfromCache();
 
function retrieveSelectionfromCache()
{
var cacheString= localStorage.getItem("QlikFilter");
if (cacheString!=null && cacheString !=""){
app.clearAll();
var selFields=cacheString.split("@");</li>
</ul>
 
 
$.each(selFields, function(key, value) {
if (value!=null && value!=""){
var valArray=[];
var s = value.split("~");
var fieldName=s[0];
valArray = s[1].split(", ");
app.field(fieldName).selectValues(valArray);
}
});
}
else{
app.clearAll();
}
 
}
 
 
} );