3 Replies Latest reply: Apr 27, 2018 12:30 PM by Jason M Schrader RSS

    Section access newbie.

    James Rizzitano

      I am new to qlik sense and have been trying to restrict data in an app based on region.  With the below code nothing is being restricted.

      All users are seeing all territories.

       

      LOAD * inline [

      ACCESS, USERID,REDUCTION

      USER, DOMAIN\admin,*

      USER, DOMAIN\dev1,MIDATLANTIC

      USER, DOMAIN\rep1,MIDATLANTIC

      USER, DOMAIN\dev2, MIDWEST

      USER, DOMAIN\rep2, MIDWEST

      USER, DOMAIN\rep3, NORTHEAST

      USER, DOMAIN\rep4, SOUTHEAST

      USER, DOMAIN\rep5, SOUTHWEST

      USER, DOMAIN\rep6, WEST

      USER, INTERNAL\SA_SCHEDULER,*

       

      ];

      section application;

       

      Territories:

      LOAD *,

       

      UPPER(SECCODEDESC) AS REDUCTION;

      SQL

      SELECT T.SECCODEID,

             T.SECCODEDESC,

             SALESREP = CASE SECCODEID

      WHEN 'F9ZI3A00000V' THEN 'Rep1'

      WHEN 'F9ZI3A000003' THEN 'Rep 2'

      WHEN 'F9ZI3A000002' THEN 'Rep 3'

      WHEN 'FTQ8T0000127' THEN 'Rep 4'

      WHEN 'F9ZI3A000005' THEN 'Rep 5'

      WHEN 'F9ZI3A000004' THEN 'Rep 6'

                         

            END,

        ANNUALBUDGET = CASE SECCODEID

      WHEN 'F9ZI3A00000V' THEN '1495700'

      WHEN 'F9ZI3A000003' THEN '1682600'

      WHEN 'F9ZI3A000002' THEN '1495700'

      WHEN 'FTQ8T0000127' THEN '1395700'

      WHEN 'F9ZI3A000005' THEN '1395700'

      WHEN 'F9ZI3A000004' THEN '1795700'

             END

           

      FROM SERVERNAME.SYSDBA.SECCODE t

      WHERE T.SECCODEDESC in ('Midwest','Midatlantic','Northeast','Southeast','Southwest','West')

      ;