Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

rcorcoran
Contributor

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
MVP
MVP

Re: sum in load script

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
Community Browser