Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
tommasogaiaspa
Contributor III
Contributor III

Problema calcolo espressione

Buongiorno sono nuovo in Qlik, avrei bisogno di aiuto per questa espressione:

sum({$<[Indicatore]={P01.01}>}[vNIind])*sum({$<[Indicatore]={P01.02}>}Peso)+sum({$<[Indicatore]={P01.02}>}[vNIind])*sum({$<[Indicatore]={P01.02}>}[Peso])

Non riesco a capire perchè come risultato mi propone 0.

Allego immagine della tabella dove ho preso i dati.

Grazie

 

2 Solutions

Accepted Solutions
Sergey_Shuklin
Specialist
Specialist

Ok, now I see that your variable contains another sum operation, so your expression looks like:
SUM({<Set Analysis>} SUM (A )/ B ) - that's why the error occurs.
You should replace this expression
sum({$<[Indicatore]={P01.01}>}[vNIind])
with this:
sum({$<[Indicatore]={P01.01}>}(Effettivo-[Range Min])*100)/([Range Max]-[Range Min])

View solution in original post

Sergey_Shuklin
Specialist
Specialist

Hello!

Please, look at the attached file.

There is a column NIobb2 where sum of rows for P01 is calculated.

And I also let myself to add column NIobb3 where the same calculation provided for all values in "Obiettivo" column.

View solution in original post

8 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!
I don't see the field vNlind on your screenshot, only Nlind.
And try to enclose P01.01 and same values into single quotes, like this: sum({$<[Indicatore]={'P01.01'}>}[vNIind])

tommasogaiaspa
Contributor III
Contributor III
Author

Ciao  grazie per la risposta ho provato con la modifica che mi hai indicato ma non funziona ugualmente.

Questa e l'espressione della variabile vNIind : sum((Effettivo-[Range Min])*100)/([Range Max]-[Range Min])

 

Sergey_Shuklin
Specialist
Specialist

Ok, now I see that your variable contains another sum operation, so your expression looks like:
SUM({<Set Analysis>} SUM (A )/ B ) - that's why the error occurs.
You should replace this expression
sum({$<[Indicatore]={P01.01}>}[vNIind])
with this:
sum({$<[Indicatore]={P01.01}>}(Effettivo-[Range Min])*100)/([Range Max]-[Range Min])

tommasogaiaspa
Contributor III
Contributor III
Author

Grazie per la soluzione, avrei bisogno anche di sommare i due risultati ottenunti dall'espressione del campo P01.01 = 15,60 e P01.02 = 28,00.

Posso farlo creando due variabili e poi sommandole o c'è un'altra maniera?

Allego immagine della tabella con i risulati dell'espressione come esempio.

 

Sergey_Shuklin
Specialist
Specialist

Not sure if I understood you correct, but you can get this result by setting to Set Analysis the followin:
sum({$<[Indicatore]={P01.01}, Obiettivo = {'P01'}...
tommasogaiaspa
Contributor III
Contributor III
Author

Cerco di spiegarmi meglio allegandoti il file .qvw di lavoro.

Prendendo come esempio indicatore P01.01 e P01.02, vorrei che gli importi del campo NIobb1 fossero sommati creando un totale del campo obiettivo P.01.

Spero di essre stao più chiaro.

Grazie

Sergey_Shuklin
Specialist
Specialist

Hello!

Please, look at the attached file.

There is a column NIobb2 where sum of rows for P01 is calculated.

And I also let myself to add column NIobb3 where the same calculation provided for all values in "Obiettivo" column.

tommasogaiaspa
Contributor III
Contributor III
Author

Grazie è la soluzione che volevo.