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

Loading Data and Group by

Hello,

I was given a task to check a script

but the thing is i have 2 questions

1- The first quwstion is do I need to Load a pre loaded  data if I will use it in the left join field ??? look at the part of the script

Left JOIN(CompanyPerformance)
LOAD

      
SalesNumber,

      
if(MaxAXESalesNumber - SalesNumber = '0', '1', '0') as FlagMaxAXESalesNumber


Resident
CompanyPerformance;

We loaded the Sales number in a previous left join ... Do we really need to load it here again ?

--------------------------------------------------------------------------------------------------------

2- The second question is do I need to load data if I will Group by the loaded data by it?? look at the second script

Left JOIN(CompanyPerformance)


LOAD

      
Origin,

      
max(SalesNumber) as MaxAXESalesNumber


Resident CompanyPerformance GROUP BY  Origin;

Thanks



3 Replies
CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

1. Yes you need to load the Sales number to join based on this field.

Because QV considers Company Performance as one table and the table derived from the company performance as another. By this it joins the data based on the common fields(field name in common).

2.Can you explain you question as briefly?

Not applicable
Author

Hi Adhimulam,

Thanks for the reply,

Regarding the first question: SalesNumber was loaded every time we used it, is that right?

I mean I can find it in at least 6 Left Join in the script.

2nd Question:

in the script we load Origin and at the end we group by Origin, do I need to Load Origin every time I will Group By Origin ?

Thanks

jagan
Luminary Alumni
Luminary Alumni

Hi,

You must load the Dimension field which is going to be used in Join.  For example in the below script

Left JOIN(CompanyPerformance)

LOAD

      
Origin,

      
max(SalesNumber) as MaxAXESalesNumber


Resident CompanyPerformance GROUP BY  Origin;

You have load Origin then only the Origin in the load table is joined with CompanyPerformance.Origin value.

Hope this helps you.

Regards,

Jagan.