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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

A simple sum not working

Hi there,

I have a simple sum that for some strange reason I cannot get it to work 100%.


The data is as follows;

Date         |Servername|HardwareStatus|Processor|CoreProcessor

Aug 2013|Server 1       |New                      |1                |2

Aug 2013|Server 2       |New                      |1                |2

Aug 2013|Server 3       |New                      |2                |4

Aug 2013|Server 4       |New                      |2                |4

Aug 2013|Server 5       |New                      |1                |1

Aug 2013|Server 6       |New                      |1                |1

Aug 2013|Server 7       |Old                      |1                |2

Aug 2013|Server 8       |Old                      |1                |2

Aug 2013|Server 9       |Old                      |1                |2

Aug 2013|Server 10      |New                      |1                |6

Aug 2013|Server 10      |New                      |1                |6


- I need to firstly Count the #number of server where the CoreProcessor is <= 4 and hardware status is "New". Then need to SUM the Processor for this.

Basically looking for a chart that shows - New | Count 6| Sum 8

- I need a view that includes the servername and one that excludes the servername



8 Replies
swuehl
MVP
MVP

=count(if(CoreProcessor <=4, Servername))

=sum(if(CoreProcessor <=4, Processor))

or

=count( {< CoreProcessor = {"<=4"} >} Servername)

=sum( {< CoreProcessor = {"<=4"} >} Processor)

used in a chart with dimension Servername or without any dimensions.

Anonymous
Not applicable
Author

Try this. See attached.

kouroshkarimi
Creator III
Creator III

I used count({<CoreProcessor={'<=4'},HardwareStatus={'New'}>}Servername)

and sum({<CoreProcessor={'<=4'},HardwareStatus={'New'}>}Processor)

How do we upload example files now?

Edit: Found it. see attached.

Not applicable
Author

hi

I think im doing something really silly ... see attachment

What I would like to see is firstly a count of all where the CorePr is <= 4 and then to SUM the ProcessCards.

It seems to have an issue because the ProcessCards has the same value.

Not applicable
Author

testcount.jpg

kouroshkarimi
Creator III
Creator III

Use If(CoreProcessor<=4,Sum(ProcesserCards),0)

But you should look into Set Analysis rather than using If statements in your expressions like that. See the examples above.

Not applicable
Author

I will look at Set Analysis ...

basically for the above sample data, the results should be Count 6 and Sum 8 ...

just not working for me

MK_QSL
MVP
MVP

Please check enclosed document...