Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
tmumaw
Specialist II
Specialist II

Logic Problem

Does anyone see anything wrong with this logic?  The CostCenterGroupHierarchy should only have records where RegionID is equal to '1'.  I am getting nothing.

thanks

Left Join (Temp)
LOAD [Profit Center],
Region
FROM
[\\kent\datastore\DaveyData\IT Projects\Qlikview\Safety\Safety Regions.xls]
(
biff, embedded labels, table is Sheet1$);

Temp1:
Load *,
if(len(trim(Region)) > 0,'1','0') as RegionID
Resident Temp;
Drop table Temp;
 

CostCenterGroupHierarchy:
Load *
Resident Temp1
Where RegionID = '1'
;
Drop table Temp1;
exit Script;

1 Solution

Accepted Solutions
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

In your WHERE clause just say

WHERE RegionID = 1; // See below

Left Join (Temp)
LOAD [Profit Center],
Region
FROM
[\\kent\datastore\DaveyData\IT Projects\Qlikview\Safety\Safety Regions.xls]
(
biff, embedded labels, table is Sheet1$);

Temp1:
Load *,
if(len(trim(Region)) > 0,'1','0') as RegionID
Resident Temp;
Drop table Temp;
 

CostCenterGroupHierarchy:
Load *
Resident Temp1
Where RegionID = 1
;

View solution in original post

7 Replies
giakoum
Partner - Master II
Partner - Master II

temp1 and cost centergroupghierarchy are auto concatenated because they have the same fields

and then dropped...

danieloberbilli
Specialist II
Specialist II

Please note that you have an Exit script before your last load.

And I  think you might need a 'NoConcatenate' in the last load - else it could be dropped

CostCenterGroupHierarchy:
NoConcatenate
Load *
Resident Temp1
Where RegionID = '1'
;
Drop table Temp1;
exit Script;

m_woolf
Master II
Master II

The CostCenterGroupHierarchy load should say:

Noconcatenate Load *

Not applicable

Hi Thom,

You should use non-concatenation.

Ramaya

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

In your WHERE clause just say

WHERE RegionID = 1; // See below

Left Join (Temp)
LOAD [Profit Center],
Region
FROM
[\\kent\datastore\DaveyData\IT Projects\Qlikview\Safety\Safety Regions.xls]
(
biff, embedded labels, table is Sheet1$);

Temp1:
Load *,
if(len(trim(Region)) > 0,'1','0') as RegionID
Resident Temp;
Drop table Temp;
 

CostCenterGroupHierarchy:
Load *
Resident Temp1
Where RegionID = 1
;

tmumaw
Specialist II
Specialist II
Author

Thanks everyone.  It works perfect.

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Am glad that worked