Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
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
Author

MEllinghausen
Creator III
Creator III

you want create filed4 in the script?

Anonymous
Not applicable
Author

Yes

MEllinghausen
Creator III
Creator III

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*';

Anonymous
Not applicable
Author

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;