Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
angelaecheverri
Creator
Creator

Set Analysis Dude

Hi dears..

I have a problem with an expression..

I have one table which several kind of Invoices NB, CB, AF, NF...

I need sum all of excepting NF invoices... and resting NF invoices again

how can i do it?

In order to be more clear lets see next example:

InvoiceValue
NB111
CB222
AF333
NF11
NF22

Total  ALL invoices will be699
ALL invoices descounting NF invoces type  will be666
Just NF invoices type will be33
I am looking for this resault... (666-33)633

I tryed:

sum({<Invoice =- {'NF'} - {'NF'}>}Value)

sum({<Invoice =- {'NF'}>-<Invoice = {'NF'}>}Value)

using P and E but it havent workt...

1 Solution

Accepted Solutions
jerem1234
Specialist II
Specialist II

This formula:

sum({<Invoice-= {'NF'}>}Value)

sums everything except NF.

This formula:

sum({<Invoice= {'NF'}>}Value)

sums only NF.

What you are trying to accomplish is:

sum({<Invoice-= {'NF'}>}Value) - sum({<Invoice= {'NF'}>}Value)

which is the formula I used.

You cannot combine this any further with set analysis, since the first sum already excludes the values of NF. You can't exclude them again in set analysis. This is why you have to break out into 2 sums and subtract. You cannot do it in the same set for set analysis.

Hope this helps!

View solution in original post

9 Replies
MarcoARaymundo
Creator III
Creator III

I

I could not understand your question.

open the attachment to see what was done.

Not applicable

Hola Angela,

Si lo que deseas es Sumar todos los valores de tu campo Value excepto los que sean Invoice = NF entonces puedes intentar lo siguiente:

sum({<Invoice=Invoice-{'NF'}>}Value)

Con esto sumas todo menos "NF".

Espero te sea de utilidad

Saludos.

(respondi en español pues vi que eres de colombia espero no equivocarme)

angelaecheverri
Creator
Creator
Author

Hola Oswaldo

Necesito sumar todas las formas mensos las NF y ademas restar el valor de las NF... como lo hago?

jerem1234
Specialist II
Specialist II

To get the result you want, you technically have to subtract the values for NF twice. So one sum with set analysis wont accomplish this, you'll have to use a second sum and subtract it from the first. This will give you a value of 633. If this isnt what you wanted please explain more. Please find attached.

angelaecheverri
Creator
Creator
Author

I don know how to sum all except NF and also how to sum just NF

what i need is sum all except NF and at the same expresion rest the value of just NF

How can I do it?

angelaecheverri
Creator
Creator
Author

Jerrem answer is quite near..

Can I do it in the same set fo Set Analysis... ?

jaimeaguilar
Partner - Specialist II
Partner - Specialist II

Hi,

maybe...

sum( {$<Invoice -= {'NF'} >} Value) - sum( {$<Invoice = {'NF'} >} Value)

jerem1234
Specialist II
Specialist II

This formula:

sum({<Invoice-= {'NF'}>}Value)

sums everything except NF.

This formula:

sum({<Invoice= {'NF'}>}Value)

sums only NF.

What you are trying to accomplish is:

sum({<Invoice-= {'NF'}>}Value) - sum({<Invoice= {'NF'}>}Value)

which is the formula I used.

You cannot combine this any further with set analysis, since the first sum already excludes the values of NF. You can't exclude them again in set analysis. This is why you have to break out into 2 sums and subtract. You cannot do it in the same set for set analysis.

Hope this helps!

Not applicable

Hola de nuevo,

Puedes Intentarlo así como Jaime te menciona o bien de esta manera:

sum({<Invoice=Invoice-{'NF'}>}Value) // Todos los valores excepto NF (666)

-                                                    // Menos

sum({<Invoice={'NF'}>}Value)            // El valor de NF (33)

Resultado 633.

Espero esto sea lo que buscas.

Saludos.