1 Reply Latest reply: Mar 26, 2016 7:39 AM by Jonathan Pitchford RSS

    Section Access using a Database

    Dalton Ruer

      Ever felt a little let down when trying to implement Section Access and all of the examples focus solely on INLINE statements?

       

      Ever wish for once you could see an example that was built using a database?

       

      Well my friends search no longer your help has arrived. In this brief 5:30 video I demonstrate how to utilize a database to source your security reductions. Since we are going to be using SQL anyway we might as well do something slick like a UNION statement to build all of the necessary rows for accounts that will need "all" of the values. That way you don't have to actually worry about maintaining those values as your system grows. You gotta love that.

       

      What's that you say? You don't have time to watch the video and just want to get the script code to do it. No problem, here you go:

      SECTION ACCESS;

       

      LIB CONNECT TO 'Security Database (qtsel_drr)';

       

      AUTHORIZATION:

      LOAD "ACCESS",

          "USERID",

          SPECIALTY;

      SQL SELECT TOP 1000 [ACCESS]

            ,[USERID]

            ,[SPECIALTY]

        FROM [QlikView_DemoData].[dbo].[SecurityTestValues]

      UNION ALL

      select 'USER', 'INTERNAL\SA_SCHEDULER', SPECIALTY

      from [QlikView_DemoData].[dbo].Specialties;

       

      SECTION APPLICATION;

       

       

       

      For that 1 person out there tempted to simply take my code and run it ... don't do that. You need to use your own database connection, your own database, your own table(s) and your own data.

       

      I would love to know if this kind of thing is helpful for you. Typically I post directly to my blog in the Healthcare Community but since this was pretty general I figured I'd throw it out here to the rest of you Qlikkies not just a couple hundred of my healthcare BFF's.