Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
adiarnon
Contributor III

EXPRESSION PROBLEM

hi,

I HAVE TWO TABLES:

Resource IDResource Name
1

A

2B
3C

DATEResource IDAVAILEBLE HOURSWORK HOURS
1.1.141910
1.1.14298
1.1.143912
2.1.14199
2.1.14298

I WANT TO SHOW A NUMBER -

HOW MANY RESURCE HAVE MORE WORK HOURS THAN AVAILEBLE HOURS

IN MY CASE - 2 :

1 - AVAILEBLE HOURS:18 ,WORK HOURS:19

3 - AVAILEBLE HOURS:9 ,WORK HOURS:12

WHAT EXPRESSION SHOULD I WRITE?

TNX.

10 Replies
Highlighted
preminqlik
Valued Contributor II

Re: EXPRESSION PROBLEM

count({<ResourceID={'=[Working Hours]>[Available Hours]'}>}ResourceID)

for distinct

count(distinct {<ResourceID={'=[Working Hours]>[Available Hours]'}>}ResourceID)

Highlighted
MVP
MVP

Re: EXPRESSION PROBLEM

In a text box, try like: =Count({<[Resource ID]={"=Sum([AVAILABLE HOURS])<Sum([WORK HOUR]"}>} Distinct [Resource ID])

Highlighted
MVP & Luminary
MVP & Luminary

Re: EXPRESSION PROBLEM

=count({<[Resource ID]={'=sum([AVAILEBLE HOURS])<sum([WORK HOURS])'}>}DISTINCT [Resource ID])


talk is cheap, supply exceeds demand
Highlighted
MVP
MVP

Re: EXPRESSION PROBLEM

Prem, you missed the aggregation. Isn't it?

Highlighted
MVP
MVP

Re: EXPRESSION PROBLEM

Try in a text box:

=count({<[Resource ID] = {"=sum([WORK HOURS]) > sum([AVAILEBLE HOURS])"}>} distinct [Resource ID])

Highlighted
Not applicable

Re: EXPRESSION PROBLEM

Use this,

Count(Distinct Aggr(sum([WORK HOURS])>sum([AVAILABLE HOURS],[Resource ID]))

Regards,

Prabhu

Highlighted
adiarnon
Contributor III

Re: EXPRESSION PROBLEM

hi,

TNX for all the answars.

iits working!!!!!!!!!!!!

BUT,

i have a Another challenge:

i want that when i click on that text box it will choose all the resource that HAVE MORE WORK HOURS THAN AVAILEBLE HOURS

how can i do that????

Highlighted
MVP
MVP

Re: EXPRESSION PROBLEM

adi arnon wrote:

....

i want that when i click on that text box it will choose all ....

You mean select ? You have to use a trigger for that. Try to share your a sample qvw.

Highlighted
adiarnon
Contributor III

Re: EXPRESSION  PROBLEM

Unfortunately i cant share.

i mean that it will select in the field 'Resource ID' all of those who HAVE MORE WORK HOURS THAN AVAILEBLE HOURS

hope its more clear