Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to apply section access for the following scenario
I have following data
User,Country,dob
U1,USA,01/01/2017
U2,UK,20/01/2017
U3,SPAIN,21/02/2017
I need to display data as
When U1 logs in then following should be displayed
User,Country,dob
U1,USA,01/01/2017
U2,UK,***
U3,SPAIN,***
When U2 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,20/01/2017
U3,SPAIN,***
When U2 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,***
U3,SPAIN,***
Hi Amar,
Sorry but i didn't understand
"
When U2 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,20/01/2017
U3,SPAIN,***
When U2 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,***
U3,SPAIN,***
"
You want to same input different outputs?
Sorry my mistake.
I need to display data as
When U1 logs in then following should be displayed
User,Country,dob
U1,USA,01/01/2017
U2,UK,***
U3,SPAIN,***
When U2 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,20/01/2017
U3,SPAIN,***
When U3 logs in then following should be displayed
User,Country,dob
U1,USA,***
U2,UK,***
U3,SPAIN,21/02/2017
Means the dob of other users should not be visible/marked as * for logged in user
Hi Amar,
You can do this, but QS only will recognize the user after you load the script.
let user= SubField(osuser(), 'UserId=',3); // Get the current user
U know how to work with "IF"?
Thanks. Is there any way to do this (hide data) at script level
There is option called |Hidden script from Load preview. May be helps this?
You can create the same load inside a If.
If(User=A)then
Load Code A
endif
If(User=B)then
Load Code B
endif
If(User=B)then
Load Code B
endif
Thanks. But I have around 900+ users. Hence want to apply some logic along with Section Access to hide the data.
Please suggest
don't think with section access, with section access you can hide data or fields (onit)
Dynamic data reduction ‒ QlikView
You can try in a chart
T3:
load * inline [
User,Country,dob
U1,USA,01/01/2017
U2,UK,20/01/2017
U3,SPAIN,21/02/2017
mydomain\myuser,ITALY,21/02/2017
];
Chart has 2 dimensions User and Country
and 1 expression
if(upper(OSUser())=upper(User), dob, '*****')
The expression is the same for all users
Ahhh ok
Try this:
Load
User,
Country
Dob
From
YouQVD
Store YourQVD
let user= SubField(osuser(), 'UserId=',3); // Get the current user
Load
User,
Country
If($user=User,Dob,'****') AS Dob
From
YourQVD