Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Specialist
Specialist

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
Highlighted
Specialist
Specialist

Re: Script Logic Problem

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

Thanks

View solution in original post

2 Replies
Highlighted
Specialist III
Specialist III

Re: Script Logic Problem

The code seems to fine for me.

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

 

Exists(NodeIDKunnr, NodeIDKunnr1)
Highlighted
Specialist
Specialist

Re: Script Logic Problem

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

Thanks

View solution in original post