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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
rcorcoran
Creator
Creator

sum in load script

Hi

I am still struggling with this.

I have the following two metrics in the Load script.  IT is brining back the two metrics as Discharges which is fine but it brings them back seperately.  I also need to bring them back added together so I wan Metric Key 3 and Metric Key 5 values added together as sum of discharges which can then be brought into a report.  Any help would be great

Thanks

 

if

((TLMKey=18 and SLMKey=142 and MetricKey=3) or (TLMKey=18 and SLMKey=142 and MetricKey=5),MetricKey) as Discharges,

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

You need something like (in an expression)

     =Sum({<TLMKey = {18}, SLMKey = {142}, MetricKey = {3, 5}>} Value)

where Value is the field containing the actual metric value.

If you want to do this in script:

     If(TLMKey = 18 And SLMKey = 142 And Match(MetricKey, 3, 5), Value)) As Discharges

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein