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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum if

Hi there,


I require assistance with creating a single sum from these to statement


SUM({<Cores={'<=4'},HardwareStatus={'Base'}>}Processor * 0.20)+


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


Regards

1 Solution

Accepted Solutions
CELAMBARASAN
Partner - Champion
Partner - Champion

It is possible only if you have the load in inline like

StatusMultiplier:

Load * Inline [

HardwareStatus, multiplier

Base, 0.20

New, 1];


Then you can simply use

SUM({<Cores={'<=4'},HardwareStatus={'Base', 'New'}>} Processor * multiplier)


Hope it helps

View solution in original post

7 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

It is possible only if you have the load in inline like

StatusMultiplier:

Load * Inline [

HardwareStatus, multiplier

Base, 0.20

New, 1];


Then you can simply use

SUM({<Cores={'<=4'},HardwareStatus={'Base', 'New'}>} Processor * multiplier)


Hope it helps

Not applicable
Author

Perfect, thank you

mr_janne
Contributor III
Contributor III

sum({<Cores={'<=4'}>} Processor * if(HardwareStatus='Base',0.20,if(HardwareStatus='New',1,0)))

israrkhan
Specialist II
Specialist II


try this:


(SUM(if({<Cores={'<=4'},HardwareStatus={'Base'}>})Processor) * 0.20)  +

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


or this


num(SUM(if({<Cores={'<=4'},HardwareStatus={'Base'}>})Processor) * 0.20, #,##0.00)  +

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



Not applicable
Author

#Israr, there is an issue with the syntax

israrkhan
Specialist II
Specialist II

' ' are missing in the second expression, around number format  '#,##0.00'

Not applicable
Author

Try that, still doesnt work

I think the problem is by the sum (if(