Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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;
The code seems to fine for me.
Can you try changing NodeIDKunnr as NodeIDKunnr1 in Temp1 and add the below code?
Exists(NodeIDKunnr, NodeIDKunnr1)
Got it to work. Did not read the customer table from memory.
Thanks