Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I've 3 users and list of customers. For the users 1 and 2 i want to show all customers data and if the user 3 logs in, i want to show all customers data except one customer.
I tried to use the below expression but not getting the value as expected.
=if(OSUser()='user3',sum({<CustomerCode-={'A'}>}SalesValue*SalesQty),sum(SalesValue*SalesQty))
Kindly help me to correct above expression.
Thank you.
Regards,
Viresh
Why don't you go for section access?
create a key which has all except one customer associated and another key with all customers associated
and then use this key in row level reduction in section access.
I agree with @passionate that Section Access sounds like the prefered way to go.
https://help.qlik.com/en-US/qlikview/November2018/Subsystems/Client/Content/QV_QlikView/Security.htm
Alternatively, if you have a Publisher, you can create different distributions for the two user types.
Hi, Thanks for the reply.
I've around 1000+ customer codes and it will increase. Is it possible to share some demo script for the same.
Regards,
Viresh
Please find below example script:
CustomerTable:
LOAD * INLINE [
CUSTOMERS, Sales
A, 122
B, 3
C, 423
D, 2
E, 3
F, 54
G, 52
H, 2345
I, 525
J, 25
K, 2454
L, 24542
M, 52
N, 4524
O, 5
P, 25
Q, 24
R, 5
S, 25
T, 2
U, 524
V, 43
W, 6
X, 54
Y, 5
Z, 467
];
MappingTable:
LOAD * INLINE [
FLAG, CUSTOMERS
ALLEXCEPTONE, A
ALLEXCEPTONE, B
ALLEXCEPTONE, C
ALLEXCEPTONE, D
ALLEXCEPTONE, E
ALLEXCEPTONE, F
ALLEXCEPTONE, G
ALLEXCEPTONE, H
ALLEXCEPTONE, I
ALLEXCEPTONE, J
ALLEXCEPTONE, K
ALLEXCEPTONE, L
ALLEXCEPTONE, M
ALLEXCEPTONE, N
ALLEXCEPTONE, O
ALLEXCEPTONE, P
ALLEXCEPTONE, Q
ALLEXCEPTONE, R
ALLEXCEPTONE, S
ALLEXCEPTONE, T
ALLEXCEPTONE, U
ALLEXCEPTONE, V
ALLEXCEPTONE, W
ALLEXCEPTONE, X
ALLEXCEPTONE, Y
];
Section Access;
LOAD * INLINE [
ACCESS, USERID, FLAG
ADMIN, ABC,
USER, XYZ, *
USER, MNO, ALLEXCEPTONE
USER, PQR, A
];
Section Application;
@passionate Your example will not work. User PQR wont see a thing and only the ADMIN ABC will see the Customer Z.
CustomerTable: LOAD * INLINE [ CUSTOMERS, Sales A, 122 B, 3 C, 423 G, 52 H, 2345 I, 525 N, 4524 X, 54 Y, 5 Z, 467 ]; Section Access;
/* OBS: important that you can reach all CUSTOMERS with selections in the SA_CUST field*/
SA_CUSTOMERS: LOAD 'ALL' as SA_CUST, CUSTOMERS RESIDENT CustomerTable; LOAD 'ALLEXCEPTONE' as SA_CUST, CUSTOMERS RESIDENT CustomerTable WHERE CUSTOMERS <> 'A'; LOAD CUSTOMERS as SA_CUST, CUSTOMERS RESIDENT CustomerTable; SA: LOAD ACCESS, USERID, SA_CUST INLINE [ ACCESS, USERID, PASSWORD, SA_CUST ADMIN, ABC, 123 USER, XYZ, 123, * USER, MNO,123, ALLEXCEPTONE USER, PQR,123, A ];
Please be careful when laborating with section access. It is possible to lock your self out of an application and never be able to open it again. I recomend you to take a backup of the qvw before proceeding with the section access implementation.
@Vegar Yes, you are right the above script was just for example. How to create flag and use in section access.
Hey guys, do not forget about the OMIT system field in Section Access, that allows you to hide fields for some users, this should be in the link that was pasted above, but I am pasting again, scroll down to the Section Access System Fields section, OMIT is described there:
https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/Security.htm
Regards,
Brett