<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Sense Mashup apply filter when loading website in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2122179#M19239</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/162307"&gt;@ARe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe it's because you have the toggle parameter set to true.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/May2023/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/FieldAPI/select-method.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/May2023/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/FieldAPI/select-method.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If toggle is true, if there is no selection in the field and you make a selection it will apply, then if you make the same selection again it will remove it, like what you are describing.&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;app.field('Tag').select([0],false);&lt;/LI-CODE&gt;
&lt;P&gt;and see if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
    <pubDate>Tue, 26 Sep 2023 00:56:25 GMT</pubDate>
    <dc:creator>Damien_V</dc:creator>
    <dc:date>2023-09-26T00:56:25Z</dc:date>
    <item>
      <title>Sense Mashup apply filter when loading website</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2116857#M19169</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I got a fairly simple mashup which just displays a table with data.&lt;/P&gt;
&lt;P&gt;when opening the mashup I would like to apply a filter to a field.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;/*
 * Basic responsive mashup template
 * @owner Enter you name here (xxx)
 */
/*
 *    Fill in host and port for Qlik engine
 */
var prefix = window.location.pathname.substr( 0, window.location.pathname.toLowerCase().lastIndexOf( "/extensions" ) + 1 );
var config = {
	host: window.location.hostname,
	prefix: prefix,
	port: window.location.port,
	isSecure: window.location.protocol === "https:"
};
require.config( {
	baseUrl: ( config.isSecure ? "https://" : "http://" ) + config.host + (config.port ? ":" + config.port : "") + config.prefix + "resources"
} );

require( ["js/qlik"], function ( qlik ) {
	qlik.on( "error", function ( error ) {
		$( '#popupText' ).append( error.message + "&amp;lt;br&amp;gt;" );
		$( '#popup' ).fadeIn( 1000 );
	} );
	$( "#closePopup" ).click( function () {
		$( '#popup' ).hide();
	} );
	function empty(heading,text){
	//console.log(heading+' '+text+': '+text.length);
	if(text.trim().length&amp;gt;2) return heading+': '+text;
	else return '';
	}
	//callbacks -- inserted here --
	function opplan(reply, app){
		//console.log(reply)
		$("#customTable").empty();
		$.each(reply.qHyperCube.qDataPages[0].qMatrix,function(k,val){
			//console.log(val[0].qText,val[1].qText,val[8].qText)
		var html="";
		html+='&amp;lt;tr&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[11].qText+'&amp;lt;!--OP--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td colspan=2&amp;gt;'+val[12].qText+'&amp;lt;!--Patient--&amp;gt;&amp;lt;/td&amp;gt;'
//			+'&amp;lt;td&amp;gt;'+val[4].qText+'&amp;lt;!--Fallzahl--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[3].qText+'&amp;lt;!--Eingriff--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[2].qText+'&amp;lt;!--Diagnose--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[17].qText+'&amp;lt;!--Allergien--&amp;gt;&amp;lt;/td&amp;gt;'
		+'&amp;lt;/tr&amp;gt;'
		+'&amp;lt;tr&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[13].qText+'&amp;lt;!--Plandatum--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[0].qText+'&amp;lt;!--ANÄ-ARt--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+val[5].qText+'&amp;lt;!--Freigabe--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Frühere OPs',val[6].qText)+'&amp;lt;!--Fr&amp;amp;uuml;hrere Ops--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Diabetes',val[1].qText)+'&amp;lt;!--Diabetes--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Lagerung',val[10].qText)+'&amp;lt;!--Lagerung--&amp;gt;&amp;lt;/td&amp;gt;'
		+'&amp;lt;/tr&amp;gt;'
		+'&amp;lt;tr&amp;gt;'
			+'&amp;lt;td&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Skelett',val[18].qText)+'&amp;lt;!--Skelett--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Infektion',val[8].qText)+'&amp;lt;!--Infektion--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Hören',val[7].qText)+'&amp;lt;!--H&amp;amp;ouml;ren--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('SM',val[14].qText)+'&amp;lt;!--Schrittmacher--&amp;gt;&amp;lt;/td&amp;gt;'
			+'&amp;lt;td&amp;gt;'+empty('Übelkeit',val[16].qText)+'&amp;lt;!--&amp;amp;Uuml;belkeit--&amp;gt;&amp;lt;/td&amp;gt;'
		+'&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td colspan=\'6\' class=\'trenner\'&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;';

			$("#customTable").append(html);
			//console.log('Länge='+val.length);
			});
}

	//open apps -- inserted here --
	//var app = qlik.openApp('7a9535c9-f560-4ac4-b1d8-3774b084e84f', config); //ssrv600
	var app = qlik.openApp('37dd6c10-3934-4d22-9275-66644639525c', config); //HN
	app.field('Tag').select([0],true);
	//get objects -- inserted here --
	app.getObject('QV03','JEnUvs');
	//app.getObject('QV02','msGvSuC');
	app.getObject('QV01','ZtjKg');
	
	
	
	
	app.getObject('CurrentSelections','CurrentSelections');
	/*
	https://jsdev.org/commercial/qlik/3.x/get-data-by-api/
	https://help.qlik.com/en-US/sense-developer/April2018/Subsystems/APIs/Content/CapabilityAPIs/AppAPI/getAppLayout-method.htm
	*/
	app.getAppLayout(function(layout){
		var qLastReloadTime = new Date(layout.qLastReloadTime);
		var curr_date = qLastReloadTime.getDate();
		var curr_month = qLastReloadTime.getMonth() + 1; //Months are zero based
		var curr_year = qLastReloadTime.getFullYear();
		var curr_hour = qLastReloadTime.getHours();
		var curr_minutes = qLastReloadTime.getMinutes();
		//alert();
		document.getElementById("qLastReloadTime").innerHTML ="Stand: " + curr_date + "." + curr_month + "." + curr_year + " "+curr_hour + ":"+curr_minutes;
		//alert(layout.qLastReloadTime);
	});
	
	
	//create cubes and lists -- inserted here --
		app.createCube({
	"qInitialDataFetch": [
		{
			"qHeight": 20,
			"qWidth": 19
		}
	],
	"qDimensions": [
		{
			"qDef": {
				"qFieldDefs": [
					"Anästhesieart"
				]
			},
			"qNullSuppression": false, //wichtig sonst fehlt die ganze zeile, wenn eintrag null ist
			"qOtherTotalSpec": {
				"qOtherMode": "OTHER_OFF",
				"qSuppressOther": true,
				"qOtherSortMode": "OTHER_SORT_DESCENDING",
				"qOtherCounted": {
					"qv": "5"
				},
				"qOtherLimitMode": "OTHER_GE_LIMIT"
			}
		},
		{
			"qDef": {
				"qFieldDefs": [
					"Diabetes"
				]
			},
			"qNullSuppression": false,
			"qOtherTotalSpec": {
				"qOtherMode": "OTHER_OFF",
				"qSuppressOther": true,
				"qOtherSortMode": "OTHER_SORT_DESCENDING",
				"qOtherCounted": {
					"qv": "5"
				},
				"qOtherLimitMode": "OTHER_GE_LIMIT"
			}
		},
		
		.....
		
	"qMeasures": [],
	"qSuppressZero": false,
	"qSuppressMissing": false,
	"qMode": "S",
	"qInterColumnSortOrder": [19,11,13],
	"qStateName": "$"
	},opplan);
	
	 
	
} );
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Problem is that the filter is not always applied.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;	var app = qlik.openApp('37dd6c10-3934-4d22-9275-66644639525c', config); //HN
	app.field('Tag').select([0],true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The page is loaded and data (without filtering) is displayed.&lt;/P&gt;
&lt;P&gt;When I hit F5 (reload) the page is reloaded and the filter is applied&lt;/P&gt;
&lt;P&gt;When I then again hit F5 the Filter is gone.&lt;/P&gt;
&lt;P&gt;... and so on -&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any ideas why?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;KR,&lt;/P&gt;
&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 08:22:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2116857#M19169</guid>
      <dc:creator>ARe</dc:creator>
      <dc:date>2023-09-14T08:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: Sense Mashup apply filter when loading website</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2122179#M19239</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/162307"&gt;@ARe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe it's because you have the toggle parameter set to true.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.qlik.com/en-US/sense-developer/May2023/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/FieldAPI/select-method.htm" target="_blank"&gt;https://help.qlik.com/en-US/sense-developer/May2023/Subsystems/APIs/Content/Sense_ClientAPIs/CapabilityAPIs/FieldAPI/select-method.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If toggle is true, if there is no selection in the field and you make a selection it will apply, then if you make the same selection again it will remove it, like what you are describing.&lt;/P&gt;
&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;app.field('Tag').select([0],false);&lt;/LI-CODE&gt;
&lt;P&gt;and see if it helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 00:56:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2122179#M19239</guid>
      <dc:creator>Damien_V</dc:creator>
      <dc:date>2023-09-26T00:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sense Mashup apply filter when loading website</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2122311#M19241</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/29425"&gt;@Damien_V&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;thanks for you reply. unfortunately setting the parameter to false has no effect.&lt;/P&gt;
&lt;P&gt;Meanwhile I opend a support case - let's see.&lt;/P&gt;
&lt;P&gt;KR,&lt;/P&gt;
&lt;P&gt;ANdreas&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 07:32:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2122311#M19241</guid>
      <dc:creator>ARe</dc:creator>
      <dc:date>2023-09-26T07:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sense Mashup apply filter when loading website</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2123710#M19249</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/162307"&gt;@ARe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We've had a look with my colleague yesterday and as he already communicated to you this is working as designed.&lt;/P&gt;
&lt;P&gt;If the same selection is already applied and you try to apply it again then it will remove it when "toggle" is true.&lt;/P&gt;
&lt;P&gt;However, the toggle option behaves in a different way depending if you use app.field.select() or app.field.selectValues()&lt;/P&gt;
&lt;P&gt;By using app.field.selectValues() with the toggle value set to false, you will get the expected behavior.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 03:22:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2123710#M19249</guid>
      <dc:creator>Damien_V</dc:creator>
      <dc:date>2023-09-29T03:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Sense Mashup apply filter when loading website</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2123755#M19250</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/29425"&gt;@Damien_V&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;yes app.field.selectValues() did the trick, thanks. I just verified yesterday in the evening and did not yet update this case &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;KR,&lt;/P&gt;
&lt;P&gt;Andreas&lt;/P&gt;</description>
      <pubDate>Fri, 29 Sep 2023 06:32:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Sense-Mashup-apply-filter-when-loading-website/m-p/2123755#M19250</guid>
      <dc:creator>ARe</dc:creator>
      <dc:date>2023-09-29T06:32:51Z</dc:date>
    </item>
  </channel>
</rss>

