Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
francisvandergr
Partner - Creator II
Partner - Creator II

Set analyses in combination with if statement

I have a question.

i have dimension called "Costcode" and 2 important fields called "amount" and  "accountno"

What i want is when a "Costcode" is selected in my object all values of Costcode must be visible. Something like :

sum( {$<Costcode = >} Amount )

But i want only amounts from "accountno"between 3000 and 4000'.

Can anybody help me with this formula ?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Hi

I think you need to clear the field [Name Costcode], you selected in, like

=sum( {<Costcode=, [Name Costcode]=, Account= {">3000<4000"} >} Amount)

Hope this helps,

Stefan

View solution in original post

7 Replies
Anonymous
Not applicable

Should be something like this ...

sum( {<Codecode=, account= {">3000<4000"} >} Amount)

Not applicable

Hi Francis, use this: if(accountno >= 3000 and accountno <= 4000, sum({$<Costcode = >} amount ))

Anonymous
Not applicable

@matytr21 -- why using an if, if this can be solved within the set analysis?

Not applicable

Yes, you have the reason, with set analysis is better

francisvandergr
Partner - Creator II
Partner - Creator II
Author

I have made an example with data. Maybe someone has now the right formula. Iw ant in the textbox a result of 230.  I attached the file

Not applicable

So you want it to display 230 even if the selections currently made are not between 3000 and 4000?

So you basically want to ignore the selections in name cost code.

swuehl
MVP
MVP

Hi

I think you need to clear the field [Name Costcode], you selected in, like

=sum( {<Costcode=, [Name Costcode]=, Account= {">3000<4000"} >} Amount)

Hope this helps,

Stefan