Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

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.

robert2012
Not applicable

sum-if-function in combination with a where-function

Hi all,

I want to use the sum-if-function in combination with a where-function. Is this possible?

The problem is that I want to use the where-function on another field.

My solution doesnt work:

sum(rangeonly(if(field1>6000 and field1<6999,field2)),  where (field3) like 'd%')          as field4

Thank you for your answers!

5 Replies
Not applicable

Re: sum-if-function in combination with a where-function

mallemalle
Not applicable

Re: sum-if-function in combination with a where-function

you want create filed4 in the script?

robert2012
Not applicable

Re: sum-if-function in combination with a where-function

Yes

mallemalle
Not applicable

Re: sum-if-function in combination with a where-function

I dont know what you want to sum, if you want in field 4 the value from filed2 if field 1 >6000 - <6999 and field3 like'd%'

you can do it so

if(field1>6000 and field1<69999 ,field2) as field4 from ......   where field3 like 'd*';

robert2012
Not applicable

Re: sum-if-function in combination with a where-function

There is still a mistake in my skript, I don't recognize.

Yes, I want to sum the vaule of field2 in field4. What do you mean with from ...Here is my skript, but with the original names - I hope this is not a problem:

Spesen_Jahr:

Load 

          Spesen_Projekt_Jahr,

            sum(rangeonly(if(Buchungs_Konto>6000 and Buchungs_Konto<6999,Umsatz_Soll))

            ) as Eregbnis_Spesen_Projekt_Jahr where MAID like 'd*'

   

Resident Primanota

group by Spesen_Projekt_Jahr;