Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Group by problem

Hello,

I´ve trying to get sum aggregation in the Load Script but without results. In the excel File appears the final results and What I want and my final Output.

This is my scritpt: Load well but appears another numbers in the field.

NoConcatenate

Temp_Can_lao2:

LOAD

Field1,

Date,

Name,

Sum( Distinct [Field 1]) as [Field 1]),

Country

Resident Temp_Can_lao1

Group By Field1,Date,Name,Country;

Drop Table Temp_Can_lao1;

Thanks!

13 Replies
pgalvezt
Specialist
Specialist
Author

Here is my script;

Temp_1:

LOAD

Branch,

FechayHora,

Nombre,

Tic,

Pais

FROM

[..\Qvd\MC\MCLAT.qvd] (qvd)

Where Date(FechayHora) >= '10/02/2018' And Date(FechayHora) < '11/02/2018';

Anonymous
Not applicable

Can post your entire load script? I'm a little confused, because it looks like you did a Resident load from Temp_2 in your reply above, but I don't see the load script for Temp_2.

If possible, can you also screenshot a preview of your table data?

pgalvezt
Specialist
Specialist
Author

This my script without resident and group by... Just the first table:

Temp_1:

LOAD

Branch,

FechayHora,

Nombre,

Tic,

Pais

FROM

[..\Qvd\MC\MCLAT.qvd] (qvd)

Where Date(FechayHora) >= '10/02/2018' And Date(FechayHora) < '11/02/2018';

Here I bring 10/02/2018... If I do a pivot table Sum(Tic) Gives 73.436.650.

If I do Sum (Distinct Tic)) Gives 850 (Correct Output)...


After this i want to group.

sasiparupudi1
Master III
Master III

At what level is 850 correct ? at the Branch level?.. may be post some sample data with the expected outcome..

or may be try a left join?

Temp_1:

LOAD

Branch,

FechayHora,

Nombre,

Tic,

Pais

FROM

[..\Qvd\MC\MCLAT.qvd] (qvd)

Where Date(FechayHora) >= '10/02/2018' And Date(FechayHora) < '11/02/2018';

Left Join(Temp_1)

Load

Distinct

Branch,

Sum(Tic)

Resident Temp_1

Group By Branch

;