Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Section Access: Don't hide data for admin user...help needed

Hi

Hi All,

I am having a section access problem. I want One user to see everything in the report, while the rest of users should see data based on reduction.  I am attaching a sample file. Please have a look at it. I need help in following two points

1) how to script section accecss so that qvservice user  sees everything in the report (Even if they have no links with other tables), while the rest of users can only see reduced data

2) Rest of users should be seeing reduced data. However, the total clients in text box should still be 6.

The section access that I have used is disabled so that you can modify the file accordingly. I was using NT Users but you can use QV users, I just to see how can I achieve the above results

Regards

Arif

6 Replies
Not applicable
Author

Is It not really not doable in Qlikview? I am not seeing any replies on this post

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

You can acheive point 1 relatively easily in QlikView, and you will find pleny of posts describing Section Access for this.  Typically you would add another field to the Section Access table rather than joining on NTNAME to the rest of the data.

The biggest gotcha with Section Access is the use of * for all values.  A user being admin does not actually grant them rights to any data, a * has to be used also (hence not using NTNAME for the join).  The * however doesn't give access to all rows, only all of the rows that are explicitly listed in Section Access.  If all values appear in the Section Access (ie. someone has explicit rights to each value) then all is good, if not you will need to add some dummy rows to the Section Access so each value is listed.  Again, you will find details of doing this on the community.

Showing the total of 6 even after Section Access has been applied is a bit 'unQlikView', as you are looking to get a result that is different to the current selection (Section Access basically applies a selection on opening the document that can't be cleared).  If you need to show that total regardless of selection or section access then you could load the value with a GROUP BY and a SUM into a data island (a table that doesn't link to anything else) so that regardless of selections it always comes out the same.

Hope that helps.

Steve

Not applicable
Author

Thanks for the post steve, I am actually new to section access and Qlikview. I have searched on community but could not find a post that could be helpful in my problem. That is why I posted a seperate thread.  Can you please explain a bit. I have the basic Idea of using section access, but I am stuck here. How will I write the section access script that will fetch all records for a user. Please note that some tables have broken links with other tables and I want this user to see those records too.

I really appreciate your help

Regards

Arif

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Arif,

This thread has some discussion and some sample code: http://community.qlik.com/message/262689

To relate it to your document though, I would suggest a different field name for the user in the Consultant table:

Consultant:

LOAD * INLINE [

    ConsultantID, Consultant Name, %USER, Consultant-Desk

    1, Shah, CONNEX\QVSERVICE

    2, Joel, CONNEX\REMOTE, 3-4

    3, Ben, CONNEX\GB1, 4-4

];

See http://bit.ly/kArYDy for why I have a % on the field name.

The Section Access part would then be something like:

Section Access;

LOAD
     ACCESS,

     NTNAME,

     USERNAME as %USER

     ;

SQL SELECT

     CASE WHEN UPPER(username) = 'CONNEX\QVSERVICE' then 'ADMIN' else 'USER' end AS ACCESS,

     UPPER(username) AS NTNAME,

     CASE WHEN UPPER(username) = 'CONNEX\QVSERVICE' then '*' else UPPER(username) end AS USERNAME

FROM [Datastar V11].dbo.Consultants;

Section Application;

This way, your QVSERVICE user should be able to see all three consultants while the other two can only see their own.

I hope that this helps.

- Steve

Not applicable
Author

Hi Steve,

Thanks a lot. As you can see, some of the clients are not joined with the Consultant table because they do not have any desk(so this is a broken link with rest of tables). For example Antti and James clients have no link with rest of tables because of missing desks. Will they still be seen QVSERVICE user? The main problem here for me is that some of the tables have missing links with other consultants, so no consultant can see that data. However, I want QVSERVICE to be able to see that data too.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Syed,

Section Access does require that there are joins to all of the data items that are included. You may need to create some dummy keys, so that everything links to something - even if it is only a value that is created during the load process.

Regards,

Steve