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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum of just one value in field

Hello guys,

I have a problem, i want to sum just one value in a table.

I use this expression:

=sum(if(Aggr(Rank(sum({$<FABRICANTE-={'Name of field to exclude'}, %Measure_N={'€sP','€cP'}, %Time.Type={'CP'}, Marca=>}Valor))=1,Valor, CATEGORIA),Valor))

im try to saying that i want the value from the number 1 in rank, whitout the name of a specific manufacturer, but e want to sum the value of the manufacturer that is in the first place.

I want to sum the value in yellow, but the expression just gives me the full amount that is 1941274, that is the sum of the 3 lines.

any one can help?

tnks!

PCordeiro

16 Replies
sunny_talwar

Would you be able to share the expression you are using for value field here?

swuehl
MVP
MVP

I think you should be able to do this, you probably just need to ignore selections in CATEGORY / FABRICANTE in your aggregation:

=Max( TOTAL

     {$<CATEGORIA=, FABRICANTE-={'Name of field to exclude'}, %Measure_N={'€sP','€cP'}, %Time.Type={'CP'}, Marca=>}

    Aggr(

          sum({$<CATEGORIA=, FABRICANTE-={'Name of field to exclude'}, %Measure_N={'€sP','€cP'}, %Time.Type={'CP'}, Marca=>} Valor)

            ,CATEGORIA, FABRICANTE // add here all dimension fields of your chart

    )

)

Not applicable
Author

=sum(if(Aggr(Rank(sum({$<FABRICANTE-={'Name of field to exclude'}, %Measure_N={'€sP','€cP'}, %Time.Type={'CP'}, Marca=>}Valor))=1,Valor, CATEGORIA),Valor))

sunny_talwar

You have highlighted Name of field to exclude above. What does this mean? Is this something you need to enter manually?

Also this did not work?

Max(

sum(if(Aggr(Rank(sum({$<FABRICANTE-={'Name of field to exclude'}, %Measure_N={'€sP','€cP'}, %Time.Type={'CP'}, Marca=>}Valor))=1,Valor, CATEGORIA),Valor))

, CATEGORIA, FABRICANTE))

Not applicable
Author

No its just the name of a company that i have to exclude, nothing in particular!

Not applicable
Author

I will try to arrange that formula, but i think its correct, because if its MAX then in the rank must be the max total as well, if its the 1st!

Not applicable
Author

It is correct, i have confirm the values! tnks a lot!