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

Same totals different rows

Hello,

I've having some problems when I join the tables, QlikView shows same values in differents weeks. What do I do wrong in my code?

I attached a sample to see what Happened.

Thanks!

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

It looks like you're doing this:

Table:
LOAD * INLINE [
ID, Value
A, 50
];
LEFT JOIN (Table)
LOAD * INLINE [
Week
1
2
3
4
];

Which produces this table:

ID  Week  Value
A   1     50
A   2     50
A   3     50
A   4     50

You get the same value for each week because your join doesn't include anything from the main table that would make only a single week number match a row. Every week number matches every row. To fix it, you probably need to do SOMETHING so that week numbers match only a single row. But I don't know what that something is, because I don't know your data and your requirements. But it looks like maybe you want to match up Fecha Inicio to Semana? It looks like at one time you used that in your join, then removed it. Perhaps removing it was a mistake?

View solution in original post

5 Replies
johnw
Champion III
Champion III

When you do this:

Join(Remuneraciones)
LOAD 
  [Período Real],
[Año Contable] &'_'& [Mes Contable]  as %LlaveCalendario,
[Año Contable]  as Año,
  Month([Mes Contable Numerico]as Mes,
[Semana Contable]  as Semana
FROM

(
ooxml, embedded labels, table is Hoja1);

That table has four rows, so every record in your table is duplicated four times - one copy of the exact same data for each week. I'm guessing you wanted your week numbers to join to the table in a bit more sophisticated fashion, just adding a week number to each row rather than duplicating the rows, but I'm not entirely clear what you are after. In any case, I'm not seeing any logic that would be able to figure out which rows should get each week number, so all rows get all four week numbers. If I'm reading it right. And if I understood what you're after.

pgalvezt
Specialist
Specialist
Author

Hi Jhon,

Thank you for your reply,

First of all I have a big data from many xls file that qlikview read simultaneously... Those xls has a field called "Fecha Inicio"... and a master calendar that dont have to show into the dashboard. Then I have another xls that I use for do a calculations (Key field there is "N° Semanas") Where for example I have Field/Field2/Max(N°Semana). The I have the other xls (That I show as attached file) I have to show that calendar into the dashboard.

How can I show that Calendar in QlikView and when I do clic in 2 or 3 or 4 Into "Semana QlikView Shows me Diferent Values For Real And Budget?. Im very stuck in this last part.

If you need more information just let me know

Thanks!

johnw
Champion III
Champion III

It looks like you're doing this:

Table:
LOAD * INLINE [
ID, Value
A, 50
];
LEFT JOIN (Table)
LOAD * INLINE [
Week
1
2
3
4
];

Which produces this table:

ID  Week  Value
A   1     50
A   2     50
A   3     50
A   4     50

You get the same value for each week because your join doesn't include anything from the main table that would make only a single week number match a row. Every week number matches every row. To fix it, you probably need to do SOMETHING so that week numbers match only a single row. But I don't know what that something is, because I don't know your data and your requirements. But it looks like maybe you want to match up Fecha Inicio to Semana? It looks like at one time you used that in your join, then removed it. Perhaps removing it was a mistake?

pgalvezt
Specialist
Specialist
Author

Jhon,

You gave me a another idea to approach this problem. I removed Join within 2 fields of that table and I realised (Fecha Inicio) Año, Mes, and now QlikView show me different values for diferents weeks. Now I have to add the budget (Last part). If I have som problems I let you know..

Thank you for your help...

kkkumar82
Specialist III
Specialist III

Why don't you mark the above Mark's reply as helpful as it helped you.

So that it will also help others to understand by your problem