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

Script Logic Problem

Hi All,

Need a little script help.  I need to get only the customers which match  the ones in AncestorNodes and Temp1.  For some reason I'm getting all of them.  Can't figure out why my exists does not work.  Thanks

ExpandedNodeNames:
Hierarchy(NodeIDKunnr, ParentKunnr, Level, [ParentCustomerGroup], [Level], [Davey Customer Hierarchy], [ / ], DepthCostCenterGroup)
LOAD
Customer AS NodeIDKunnr, //NodeID
HgLvCust AS ParentKunnr, //ParentID
Customer AS Level
RESIDENT KNVH
;

ExpandedNodesCustomer:
Hierarchy(NodeIDKunnr, ParentIDGroup, Node, [ParentGroup], [Node])
LOAD
Customer AS NodeIDKunnr, //NodeID
HgLvCust AS ParentIDGroup, //ParentID
Customer AS Node

RESIDENT KNVH
;

//AncestorNodes:
Temp:
HierarchyBelongsTo (NodeIDKunnr, ParentIDCustomerGroup, Level, AncestorIDCustomerGroup, AncestorNameCustomerGroup, DepthDiffCustomerGroup)
LOAD
Customer AS NodeIDKunnr, //NodeID
HgLvCust AS ParentIDCustomerGroup, //ParentID
Customer AS Level
RESIDENT KNVH
;

DROP FIELD Level
;
NoConcatenate
AncestorNodes:
Load *
Resident Temp
;
DROP Table Temp
;

Temp1:
LOAD KUNNR,
NodeIDKunnr,
CustomerName
FROM
[D:\Qlikview\New Sales\QVD\KNA1Hierarchy.QVD] (qvd)
;

NoConcatenate
Customers:
LOAD *
Resident Temp1
WHERE exists (NodeIDKunnr,NodeIDKunnr)
;

Drop Tables KNVH, Temp1
;
Exit SCRIPT;

Labels (1)
1 Solution

Accepted Solutions
tmumaw
Specialist II
Specialist II
Author

Got it to work.   Did not read the customer table from memory.

Thanks

View solution in original post

2 Replies
Saravanan_Desingh

The code seems to fine for me.

Can you try changing NodeIDKunnr as NodeIDKunnr1 in Temp1 and add the below code?

 

Exists(NodeIDKunnr, NodeIDKunnr1)
tmumaw
Specialist II
Specialist II
Author

Got it to work.   Did not read the customer table from memory.

Thanks