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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Problem with columns and Sum Total

Hello,

I have many Expressions. Many of them works fine but some columns shows "-" and doesn't sum too whe the values are correct.

I attached a file

Thanks.

15 Replies
pgalvezt
Specialist
Specialist
Author

Many Thanks Michael.

I tried of follow with the others expression but doesn´t work. Can you help me with the big one (Cantidad Entre 0 - 1 AÑO), And can follow with the others.

Thanks again!

Anonymous
Not applicable

I'll give you this one, but you have to figure out the rest..

First, I re-wrote the expression to make it look simpler.  Logic is the same, please verify:
if(Column(8)=0 AND Column(6))>0 AND (Sum(cantidad2_oh)-Sum(patrimonio))>=0 AND (Sum(cantidad2_oh)-Sum(patrimonio))<=Column(6), (Sum(cantidad_oh)-Sum(patrimonio)), 0)

Next, I replaced Column(6) and Column(8) with their actual expressions:

if(if (nuevo = 1, If((aggr(Sum(cantidad_oh),articulo) - aggr(Sum(patrimonio),articulo)) < 0, '0', Sum(cantidad_oh) - Sum(patrimonio)), '0')=0 AND Sum(consumo)>0 AND (Sum(cantidad2_oh)-Sum(patrimonio))>=0 AND (Sum(cantidad2_oh)-Sum(patrimonio))<=Sum(consumo), (Sum(cantidad_oh)-Sum(patrimonio)), 0)

So far, it returns the same result as your expression.

And, the last step was the same as before, adding sum(aggr()):

sum(aggr(

if(if (nuevo = 1, If((aggr(Sum(cantidad_oh),articulo) - aggr(Sum(patrimonio),articulo)) < 0, '0', Sum(cantidad_oh) - Sum(patrimonio)), '0')=0 AND Sum(consumo)>0 AND (Sum(cantidad2_oh)-Sum(patrimonio))>=0 AND (Sum(cantidad2_oh)-Sum(patrimonio))<=Sum(consumo), (Sum(cantidad_oh)-Sum(patrimonio)), 0)

, articulo))

Regards,

Michael

pgalvezt
Specialist
Specialist
Author

Thats the idea many thanks Michael!!

pgalvezt
Specialist
Specialist
Author

Hi Michael,

I have proved some formulas but I fail to multiply columns. Can you help me with this?

I have tried first:

Column(4) * Column(8) nothing

Sum(Column(4) * Column(8)) Exceed Memory

Sum(Column(4)) * Sum(Column(8)) Exceed Memory

With Aggr I fail too.

Thanks!

pgalvezt
Specialist
Specialist
Author

Michael,

My formula It was fine. I dont Know QlikView Displayed a $ as total (Weird Right?). When Export to excel Appear the final result.

$ 1.139.920.299.839.620

I attached the problem.

Thank you for your help.

Not applicable

you have every thing is good on your side only one presentation setting that i fix in application attached with this text.