Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have one table which has field 'USER_ID' and other fields, so particular user can see associated data.
How do I join NT_ID(Window Log in) to USER_ID(Table) without section access. So user can access only their data
Your reply is highly appreciated...Thanks
Check out function OSUser(). No parameters. Returns the Windows account of the current document user (both in Desktop and in AP client) in the format
domainname\accountname
Best,
Peter
Sorry, OSUser() will only serve you in the UI, which is not exactly what you are asking. However, the user ID of a visitor is only known when the document is opened, not at reload time.
The script can provide restrictions to be applied later on at the time a document is opened only via Section Access and data reduction.
IMHO the only other technique that does not make use of section access or data reduction consists of using OSUSer() in set analysis to reduce displayed data in every object to what the current user is allowed to see by your special table.
Peter
Hi Peter
Thanks for prompt reply.
How do I load OSUser() in order to connect with USER_ID from one of the table in scrpting
Thanks
You do not.
OSUser() is a function that returns the ID of the user that has your document open. In the load script, you would get the ID of the account that is reloading the document (probably a service account).
If you do not want to use Section Access or any of the related features, then you keep your document as is. Imagine that you have a chart with a single expression, say Sales.The expression for your chart now becomes:
=Sum({<USER_ID = {"$(=OSUser())"}>} Sales)
which will restrict aggregation to only those amounts that are associated to the current user.
But I think that you should evaluate Section Access as a solution. It works very well.
Peter
Hi,
May be this blog will help http://community.qlik.com/blogs/qlikviewdesignblog/2014/06/09/methods-for-data-reduction
Hi Gabriel
Excellent suggestion and appreciable.
But I already have developed the report and finding way to restrict data at script level Or Sheet level?, if possible.
Thanks for your valuable effort
Then there is only one solution: Section Access with Data Reduction. What makes this solution unique is that it loads all data into your document, and prepares a mechanism that is triggered whenever a user opens your document. Only then will the data be reduced, without further load on your associative model. You won't need to change your User Interface, except if you want to make objects and/or sheets show up depending on the user that opens the document.
Peter
Hi Peter
Your suggestion is nice and helpful to me.
Thanks for your valuable time