Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

anavin33
Not applicable

Using the sum function - narrowed down

Hi,

So I am using the sum function in a chart, as an expression, to add the original amount of loans all together. The problem I'm having is that the function is adding all the original amounts for every production date for every loan. So the number is much greater than it should be. Is there a way I can specify the function so that the original amount is only counted on a specific production date?

Thanks

6 Replies
israrkhan
Not applicable

Re: Using the sum function - narrowed down

share your sample document.

what are your dimension and expressions???

Not applicable

Re: Using the sum function - narrowed down

Have you tried using any set analysis?   If you narrowed down the sum to only include the min(date) that could solve your problem

Not applicable

Re: Using the sum function - narrowed down

What are the names of the fields you have involved?

anavin33
Not applicable

Re: Using the sum function - narrowed down

prod_dt is what i want to narrow down by, orig_amt is what I want to sum together, and I'm limiting it to a certain loan type using the variable PresentLoanType

if(PresentLoanType <> 'Serviced for others', sum(orig_amt), )

This is the if statement I am using as the expression in the chart, but like I said the function is counting the orig_amt for every prod_dt when I just want it from one prod_dt

Not applicable

Re: Using the sum function - narrowed down

Try

sum({<PresentLoanType -= {'Serviced for others'}, prod_dt = {'$(=date(min(prod_dt)))'}>}orig_amt)

anavin33
Not applicable

Re: Using the sum function - narrowed down

This set analysis just changes all the amounts to zero