Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Color setting based on OSUser

Hi All,

I'm trying to set the color of bars in a graph when a user logs in to show ones that relate to them, but with no selections made.

I've got a version of this function working, but it requires a user to make a selection before this happens. What I'd like is to have this happen on login without any macros (as the client version needs to be Ajax).

Any thoughts?

Thanks

Gavin

8 Replies
Not applicable

Re: Color setting based on OSUser

Maybe some OnOpen trigger?

jaimeaguilar
Valued Contributor II

Re: Color setting based on OSUser

Hi,

try modifying the background color property in your expression with:

=pick(WildMatch(OSUser(), 'Domain\User1', 'Domain\User2', 'Domain\User3'), Green(), Red(), Yellow())

You just have to replace the users and the colors you wish to use,

see the attached example,

regards

Not applicable

Re: Color setting based on OSUser

Thanks, I think that the trigger may work, but not sure what to use for it.

Jaime, the example you posted is helpful, but what I want to do is color just one of the bars (say Green) and the rest stay blue.

So if there was a bar chart that showed division and I had 5 divisions, I only want the division I belong to be color changed, the rest stay as they were.

thanks

Gavin

jaimeaguilar
Valued Contributor II

Re: Color setting based on OSUser

Hi,

then you have to add the condition for changing just one bars, besides the condition for the color depending on OSUser():

if(CONDITION_IS_TRUE,

pick(WildMatch(OSUser(), 'Domain\User1', 'Domain\User2', 'Domain\User3'), Green(), Red(), Yellow())

)

this way, the bar will change color only if the condition is fulfilled,

regards

MVP
MVP

Re: Re: Color setting based on OSUser

1.png

Not applicable

Re: Color setting based on OSUser

Hi massimo

Can you post up the qvw?

Many thanks

Gavin

MVP
MVP

Re: Color setting based on OSUser

is already attached to my prev post

Not applicable

Re: Color setting based on OSUser

Hi Massimo,

Yes it was (my mistake) I was looking through a mobile device that didn’t pick-up the attachment.

Many thanks

Gavin

Community Browser