7 Replies Latest reply: Jul 24, 2012 11:25 AM by Wojciech Parzyszek RSS

    Section Access - union multiple fields

      I have an application where I need to set up Section Access to limit a user to seeing only the region that he is assigned, but also other regions that he may have opportunities to develop.

       

      Which means I need to use multiple fields in the Section Access setup, but I need them to produce a UNION with each other, rather than the INTERSECTION.

       

      Heres' my Section Access script:

       

      Section Access;

      LOAD * INLINE [

          ACCESS, USERID, PASSWORD

          ADMIN, ADMIN, ADMIN

          USER, USER1, U1

      ];

       

      Section Application;

      star is *;

      load * inline [

      USERID,RegionReduction,TRegionReduction

      ADMIN,*,*

      USER1,Illinois,OH/Northeast

      ];

       

      GrowerList:

      LOAD GWR_ACCT_ID as [Account ID],

           GWR_FIPS_CODE as [FIPS Code],

           Proposed_2012_Region_Code as [Geo. Region Code],

           Proposed_2012_Region_Name as [Geo. Region Name],

           MKT_YR as [Market Year],

           BRAND as Brand,

           CROP as Crop,

           if(BRAND='HUBNER','OH/Northeast',(if(BRAND='LEWIS','MO/KS/CO','Illinois'))) as [Transaction Region],

           SumOfUNITS,

           Proposed_2012_Region_Name as RegionReduction,

           if(BRAND='HUBNER','OH/Northeast',(if(BRAND='LEWIS','MO/KS/CO','Illinois'))) as TRegionReduction

      FROM

      [Q:\Stengler\SecTest\New Microsoft Office Excel Worksheet (3).xlsx]

      (ooxml, embedded labels);

       

      When loaded, the above rsults in only one row, with 'RegionReduction' = 'Illinois' and TRegionReduction' = 'OH/Northeast'  THis is as expected, but not what I need. What I need is for it to return all rows that have 'Illinois' in 'RegionReduction' as well as all rows that have 'OH/Northeast' in 'TRegionReduction'.

       

      I've attached the QVW. Use 'ADMIN' as the ID & PW. 'USER1 & 'U1' is the regular userid/pw.

       

      Sam