Discussion board where members can get started with Qlik Sense.
Is there anyone available to explain how to write the model app script?
Check with this. May be useful
hi, thank you for your answer, but I want scriptn for ODAG!
For ODAG need to create two apps
1. one for summary app which is you Final UI app where you will apply selections.
2. Detail app - here need to write the ODAG Script.
if you are working with sql database need to follow the below code just update with your fields everything remains same
// DO NOT ALTER THIS SUBROUTINE
SUB ExtendWhere(Name, ValVarName)
LET T = Name & '_COLNAME';
LET ColName = $(T);
LET Values = $(ValVarName);
IF len(Values) > 0 THEN
IF len(WHERE_PART) > 0 THEN
LET WHERE_PART = '$(WHERE_PART) AND $(ColName) IN ( $(Values) )';
LET WHERE_PART = ' WHERE $(ColName) IN ( $(Values) )';
SET ACCOUNTID= ;
SET ACCOUNTID= $(ods_ACCOUNT); //this ACCOUNT field name should match with your summary app field
SET ACCOUNTID_COLNAME='a.accountid'; //this a.accountid field name should match with your database field
SET COMPANYID= ;
SET COMPANYID= $(ods_COMPANY);
SET WHERE_PART = '';
//First Set Statement Variable fields ACCOUNTID, COMPANYID need to pass at For Loop
FOR EACH fldname IN 'ACCOUNTID', 'COMPANYID'
LET vallist = $($(fldname));
WHEN (IsNull(vallist)) LET vallist = '';
IF len(vallist) > 0 THEN
TRACE Generated WHERE clause: ;
1 AS "FLIGHT_COUNT",
ACCOUNTID as "ACCOUNT",
COMPANYID as "COMPANY";