Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Highlighted
mohanrajsubrama
New Contributor II

Hiding the Expression based on the user login through session access

Hi Team,

Is it possible to hide the expression in the chart through session access.

EX: lets say I have the below pivot table with 2 dimension with 3 measures.

I have a user called David & Nancy. My requirement is when David logins he has to see product, Sub type Sales & Cost.

But when Nancy logins she has to see all the columns.

productSub typesalescostmargin
AAA1500400100
BBB500400150
CCC680400170

 

Regards,

Mohan.

Labels (1)
5 Replies
anushree1
Valued Contributor

Re: Hiding the Expression based on the user login through session access

You can try by creating an inline table with the user id and a flag for instance:

NAME        FLAG

A                  1

B                  0

C                  1

 

The above table must contain al the userIDs and mark those Ids for whom the expression must be visible as 1

in the conditional expression write if (only({<Name={'$(vID)'}>})FLAG)=1,1,0)

vID should be a variable declared as =OSUSER()

Please take care of the Case OSUSER and Names is the Inline table must be of same case

pradosh_thakur
Honored Contributor II

Re: Hiding the Expression based on the user login through session access

mohanrajsubrama
New Contributor II

Re: Hiding the Expression based on the user login through session access

Thanks for your help.
I tried with the above approach just with 2 users .But the problem is when I changed the flag to 1 to 0 ,the above expression is not handling it.
I mean initially if the flag is 1 I am able to see the column. After changing it to 0 ,I am still seeing the column.
mohanrajsubrama
New Contributor II

Re: Hiding the Expression based on the user login through session access

Hi ,
This method I tried before Pradosh..But this looks like omitting the field rather the whole expression.

Thanks in Advance,
Mohan
anushree1
Valued Contributor

Re: Hiding the Expression based on the user login through session access

well but thats probably because you are checking and for you the flag is 1

Change the flag to 0 on your Name in the inline table, hope its clear