Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
mparker123
Creator
Creator

Total Hours

Hello All,

I have this formula but it doesn't seem to work.           If(HOURS='0' and DEPT='44840',MONTH)


The only problem with this is that I need it to be IF Total HOURS=0. How do I write a formula that looks at Total Hours and returns the MONTH field?

Labels (1)
8 Replies
Kushal_Chawda
MVP
MVP

Where you are writing this formula? Is it calculated dimension?

try below

=sum(aggr(if(sum(HOURS)=0 and and DEPT='44840',Month),DEPT,Month))

prieper
Master II
Master II

in script or in application?

What do you mean with "Total Hours"? Is this a field or should it be the sum of hours or HOURS?

its_anandrjs
Champion III
Champion III

In the loading script you are doing this or what

Try

Load

If(HOURS = 0 and DEPT = '44840', MONTH) as FieldName

From Source;


Or


If(HOURS = 0 and DEPT = 44840, MONTH)

mparker123
Creator
Creator
Author

In application.

HOURS is the Field name but I want to total the HOURS. In the data set you can have a zero hours logged in one project and 8 hours logged in the other. The way I have the formula it will still show me the MONTH because there is a zero showing in that DAY, so i want to total the HOURS for the day so this doesn't show up.

mparker123
Creator
Creator
Author

I am writing an expression in the application

its_anandrjs
Champion III
Champion III

Can you provide expected op with example to explain.

mparker123
Creator
Creator
Author

Posted an example

prieper
Master II
Master II

You have used a "Table Box", in which you cannot calculate.

Change to "Straight Table" and have under Presentation "Suppress Zero" and you should get something like the below.

HTH Peter