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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rbartley
Specialist II
Specialist II

Qlik Sense Mashup API - Detecting Calculation Condition

Dear all,

I would like to display a message below my line chart, but only if the calculation condition has been met, i.e. the chart is displayed and not the custom message.  I have been able to determine that Qlik uses the class "object-error" for the div that shows the 'error' and so I am using the following code:

app.createList({

"qDef": {

"qFieldDefs": [

"[Marketing Year]"

]

},

"qInitialDataFetch": [{

qTop : 0,

qLeft : 0,

qHeight : 100,

qWidth : 1

}]

}, function(reply) {

console.log('Marketing Year changed');

changeVisibilityAxisLabel();

});

.......

function changeVisibilityAxisLabel()

{

var intErrorMessage = $('.object-error').length;

if(intErrorMessage!=0)

{

$('#imgLineYearComparisonAxisLabel').hide();

}

else

{

$('#imgLineYearComparisonAxisLabel').show();

}

}

However, I wonder whether there is  better way, since I am having to use a timeout to cope with the synchronisation issues between the filter being selected and the chart updating to display the chart or error message.

0 Replies