max


How can Max() work within sumif in an expression on Qliksense?


I wrote an expression to find the sum of [Spend by Vendor] for those ranked top 10 in [Benefit].
Sum(if([H4 Benefit by Vendor] > Max([H4 Benefit by Vendor],11), [Spend by Vendor],0))/sum([Spend by Vendor])
However, this expression did not work.
I tried to separate the expression into two and tested. (Replaced the Max() part with 0)
Sum(if([H4 Benefit by Vendor] >0, [Spend by Vendor],0))/sum([Spend by Vendor])
Max([H4 Benefit by Vendor],11)
They worked fine independently. However, it could not work when combining together.
May I know is there any method to combine these two together?
The issue is comparing the aggregated value with the row value - you can't do this directly but there are a few options as per this thread.
The way I would do this is to set a variable on the load script
Temp:
load
max([H4 Benefit by Vendor]) as maxB
resident TABLENAME;
LET vBenefitMax = peek('maxB');
drop table Temp;
and then refer to that in your If statement.
Sum(if([H4 Benefit by Vendor] > vBenefitMax, [Spend by Vendor],0))
/ sum([Spend by Vendor])

Related Links

OpenCL find maximum value and position in an array
How can I calculate the longest duration in XQuery?
Find the Maximum of an input vector in verilog
How to get other attributes in aggregation result (Relational Algebra)
Wind scaling in Maxscript
when I run this join ..it throws an error
Qlikview Max Aggr Value
Error when installing “RODBC” package
InfluxDB get maximum value of moving average
Subtract price on same Table
Julia: Find the indices of all maxima
How can Max() work within sumif in an expression on Qliksense?
Excel 2010 - Visual Basic code to find minimum and maximum values based on different criteria
How do I call for a max in an array(pascal)
Does AVAssetWriterInputPixelBufferAdaptor have a global maximum of 3 instances?
How to show results in text, not digits

Categories

HOME
pact
model-view-controller
azure-active-directory
domain-driven-design
azure-database-mysql
data-modeling
itext7
ebay
ms-access-2010
kohana
schema
webpack-dev-server
segmentation-fault
coding-style
google-app-maker
facebook-sharer
osclass
websharper
logstash-configuration
yui
react-select
filehelpers
ibatis
novacode-docx
glibc
descriptor
restructuredtext
connectiq
policy
ppp
rancher
marionette
semantic-ui-react
xlib
schedule
slim-lang
wercker
contextmenustrip
restler
aweber
azure-storage-files
strategy-pattern
const
libconfig
var
byobu
ssdp
keychain
android-graphview
electron-packager
amazon-rds-aurora
libzip
spring-data-commons
activeandroid
pyopenssl
dcom
jcifs
htop
blackberry
bipartite
scrollmagic
optional-parameters
papyrus
init
user-profile
bbedit
dynamics-nav
gtkwave
sdkman
winforms-interop
azure-mobile-app
tokudb
firewire
genome
maven-archetype
asp.net-2.0
report-builder2.0
system.io.packaging
os.walk
react-os
nsnotificationcenter
worklight-appcenter
javacompiler
ios-enterprise
azure-worker-roles
msdropdown
kernel-density
facebook-java-api
playing-cards
mysql2
servicemanager
mmo
system.transactions
ntdll
database-restore
zepto
commonsware
idtabs
sipdroid
netbeans7.0
versions
dojox.gfx
morfik
coderush-xpress
jgrowl
moores-law
hotfix
urlscan

Resources

Encrypt Message