Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

afsar_shaikh12
New Contributor III

List data only if possible values are true

Hi Everyone,

I stucked in some logic and i need a help from you.

I'm sharing an example below, which has 3 columns as Manager, Employee and Project Assigned.

I wan't to list only those manger whose all employees have project assigned.

So, in below example only Manger XYZ should be shown since, under him everyone's project assigned. Also, Manager 'ABC' shouldn't be displayed since, it has N and NULL values.

Could anyone help me to achieve this? Thanks

Manager EmployeeProject Assigned
ABCE1Y
ABCE2N
ABCE3NULL
XYZE4Y
XYZE5Y
XYZE6Y

Regards,

Afsar Shaikh

1 Solution

Accepted Solutions
MVP
MVP

Re: List data only if possible values are true

Try this in a text box:

=Concat(DISTINCT{<Manager={"=Count(Distinct Employee)=Count(Distinct {<[Project Assigned]={'Y'}>} Employee)"}>}Manager, ',')

11 Replies
MVP
MVP

Re: List data only if possible values are true

=Concat( Aggr(If(Only([Project Assigned])='Y',Manager), Manager),', ')

e.g. in a text box

MVP
MVP

Re: List data only if possible values are true

Try this in a text box:

=Concat(DISTINCT{<Manager={"=Count(Distinct Employee)=Count(Distinct {<[Project Assigned]={'Y'}>} Employee)"}>}Manager, ',')

afsar_shaikh12
New Contributor III

Re: List data only if possible values are true

Thanks for your reply Stefan.

However, i'm still getting NULL values.

afsar_shaikh12
New Contributor III

Re: List data only if possible values are true

Thanks for your reply Tresesco.

However, i'm still getting NULL values.

I wan't to display a manager name only if all the values are Y in column 3.

If any of the value is other than Y, no manager to be displayed.

Re: List data only if possible values are true

Hi,

create listbox with below expression

Aggr(If(Only([Project Assigned])='Y',Manager), Manager)

Regards,

Regards,
Prashant Sangle
MVP
MVP

Re: List data only if possible values are true

Do you have a sample? In my sample it is working fine. PFA

Re: List data only if possible values are true

try like below,

create a key in table,

load *,

       recno() as Key

FROM table;

Now try below expression

=Concat(DISTINCT{<Key={"=Count(Distinct {<[Project Assigned]={'Y'}>} Employee)=Count(Distinct {<[Project Assigned]={'Y'}>} Manager)"}>}Manager, ',')

afsar_shaikh12
New Contributor III

Re: List data only if possible values are true

I don't have sample data but, I've <space> as a value in my 3rd column. So, it's considering that too...

MVP
MVP

Re: List data only if possible values are true

No, that should not be the reason, only 'Y' values is being considered.

Community Browser