Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need help with macro function

Hello,

I have 3 tables

Customer ( Codcli: code of customer, Descli: description of Customer)

CodcliDescli
aAA
bBB
cCC
xxyy

Contract ( Codcon: codd of Contract, Codcli: code of Customer)

CodconCodcliflag
CCCc 1
zzxx0

Tree(Codcli:code of customer, sup: Code of superior element)

Codclisup
ac
bxx
xxa
c0

is a tree structure

c

|
|------a

       |

       |------xx

               |

               |_____b

I need to implement a function that verify if the Customer have a contract:

If a Customer have contract in the table contract, I must take his contract, if he don't have contract I must to take the contract of

this superior element that have flag=1. So if Customer b don't have a contract, I cannot take a contract of the Customer xx, but I must take the contract

of c that have flag=1.

Should I use a Macro ?

Can I find the contract in Load Script?

Can you give me a suggest?

Thanks

2 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Find the attached file, hope it helps you.

Regards,

Jagan.

Not applicable
Author

Hi

Jagan thank you for your answer, but I must to have this situation

Customer  ---->   Contract

c   --------->   CCC    (OK)

a   ---------->  CCC    (OK)

xx  ------------> zz     (OK)

b  --------------> CCC (KO because b take contract of c Customer)

I will study your resolution

Regards

Oronzo