Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

joeybird
Contributor II

expression based on filter and osuser


Hi

I only wish to sum on person logged in

I have a text box that shows show's who's logged in via a windows login using

domain = OpenWorld

Username =jo111111

on text box expression is

osuser()

this gives me UserDirectory=OpenWorld;UserId=jo111111

I have a filterpane called UserId that contains jo111111

there is a chart showing sales, my expression is like this, but it does not work I only wish to sum on person logged in

sum ({$<OSUser= {UserID}>}SALES)

how can I get this to work please

1 Solution

Accepted Solutions

Re: expression based on filter and osuser

How about this:

Sum({$<UserID = {'$(=SubField(OSUser(), '=', -1))'}>}SALES)

11 Replies

Re: expression based on filter and osuser

How about this:

Sum({$<UserID = {'$(=SubField(OSUser(), '=', -1))'}>}SALES)

joeybird
Contributor II

Re: expression based on filter and osuser

fab , thank you x

Re: expression based on filter and osuser

No problem at all

joeybird
Contributor II

Re: expression based on filter and osuser

Hi

sorry I am having issues using this expression with {$<UserID = {'$(=SubField(OSUser(), '=', -1))'}>}, this does not seem to work within use of an IF statement, how can it please be amended?

count({$<UserID = {'$(=SubField(OSUser(), '=', -1))'}>}CustID)

also I have a table on a sheet...this gives me 0 or 1, how can I then limit the count to 1 on the table please?

Please help

Re: expression based on filter and osuser

Within the if statement? Can you share the expression you are trying to use?

joeybird
Contributor II

Re: expression based on filter and osuser

Hi

here is the IF statement

if(DFlag = 'No', MODE({$<[Country] ={"France"}, Department_Number = {1}, UserID = {'$(=SubField(OSUser(), '=', -1))'}>}Sales), mode({$<[Country] ={"France"}, Department_Number = {2}, UserID = {'$(=SubField(OSUser(), '=', -1))'}>}Sales))

please help

joeybird
Contributor II

Re: expression based on filter and osuser

Hi

please see below

please help

Re: expression based on filter and osuser

Can you try this:

If(DFlag = 'No',

Mode({$<[Country] = {'France'}, Department_Number = {1}, UserID = {"$(=SubField(OSUser(), '=', -1))"}>}Sales), Mode({$<[Country] = {'France'}, Department_Number = {2}, UserID = {"$(=SubField(OSUser(), '=', -1))"}>}Sales))

joeybird
Contributor II

Re: expression based on filter and osuser

Hi

this worked, issue still with table chart on a sheet. any ideas please?  I have tried to use a flag, but no joy.

Community Browser