Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

sum expression error

Hi everyone,

      i want to show you an strange issue.

I have the table 1.

table 1.png

I don't know why but when i use the sum expression the values are wrong (see table 2)table 2.png)...

The real value of sum is 51.

Can someone help me?

Thanks!

1 Solution

Accepted Solutions
sebastiandperei
Specialist
Specialist

hay que ver qué hay en los QVD...Intuyo q están en SUBSCRIPTIONS. Qué hay acá? Lo más probable es que tengas varios registros por cada user_id.

Le estás diciendo a Qlikview:

1- Leé las claves de SUBSCRIPTIONS.QVD y creá dos campos con nombres diferentes por cada una (acá es muy probable que estén repetidos)

2- Leé de DEAL_EXTERNALS.QVD tales datos, y emparentalos con cada clave leída.

Si tenés por ejemplo user_id A, A, A, B, B, C, C, C, C,... te va a poner los datos de quantity que se corresponden en la segunda tabla con A, 3 veces, con B, 2, y así....

Tenés que tener un buen conocimiento de qué hay en cada qvd antes de leerlo.

View solution in original post

19 Replies
Not applicable
Author

hello


why not rename the field with no points from the script


DEAL_EXTERNAL.quantity_A as Quantity


regards


Not applicable
Author

sorry, there was an error loading the pictures....now are ok.

Not applicable
Author

could you post an image of your table view?

Not applicable
Author

Hi Juan,

I attached two images in the main question.

Thanks

gerardo

De: Juan Fibonacci

Enviado el: jueves, 19 de abril de 2012 04:36 p.m.

Para: Pauza, Gerardo

Asunto: - Re: sum expression error

QlikCommunity <http://community.qlik.com/index.jspa>

Re: sum expression error

created by Juan Fibonacci <http://community.qlik.com/people/dragonauta> in New to QlikView - View the full discussion <http://community.qlik.com/message/212103#212103

Not applicable
Author

i meant an image of your internal table view (CTRL + T)

Not applicable
Author

Juan, here is the table internal view

SUBSCRIPTIONS_A:

LOAD

user_id as %Key_USER_ID_A,

user_id as user_id_A

FROM (qvd);

INNER Join

load

Year(created) & Num(Month(created),'00') & Num(Day(created),'00') as %Key_CREATED_DEAL_EXTERNALS,

user_id as %Key_USER_ID_A,

user_id as user_id_A,

quantity as quantity_A,

id as deal_externals_id_A

FROM (qvd)

where `external_status` = 'A';

De: Juan Fibonacci

Enviado el: jueves, 19 de abril de 2012 05:44 p.m.

Para: Pauza, Gerardo

Asunto: - Re: sum expression error

QlikCommunity <http://community.qlik.com/index.jspa>

Re: sum expression error

created by Juan Fibonacci <http://community.qlik.com/people/dragonauta> in New to QlikView - View the full discussion <http://community.qlik.com/message/212127#212127

adhudson
Creator II
Creator II

Hi,

     If it is possible, please attach the actual qvw file.

Regards

Andrew Hudson

Not applicable
Author

Hi Andrew,

I send you the qvw.

Sorry but i had to reduce the data.

Thanks for any advice

Gerardo

De: Andrew Hudson

Enviado el: jueves, 19 de abril de 2012 09:32 p.m.

Para: Pauza, Gerardo

Asunto: - Re: sum expression error

QlikCommunity <http://community.qlik.com/index.jspa>

Re: sum expression error

created by Andrew Hudson <http://community.qlik.com/people/adhudson> in New to QlikView - View the full discussion <http://community.qlik.com/message/212163#212163

jagan
Luminary Alumni
Luminary Alumni

Hi,

I found that your data has duplicate values.  Also Your Table has no Unique key that is why you are getting different values when displaying in table and when you are summing up.  I attached your modified file with RowNo() added to a table.  Hope it helps you.

Regards,

Jagan.