Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

michielvandegoo
Valued Contributor

Link table results in synthetic key

Hi,

I created this script but it doesn't result in a link table but it results in a synthetic key.

I don't understand why.

The content of the fields are exactly the same.

Thanks for you help.

Script:

LinkTable:

load Distinct

    BudgetKey,

    year(AddMonths(OrderDate, $(vFiscalOffset))) as BudgetYear,

    ceil(month(AddMonths(OrderDate, $(vFiscalOffset)))/3) as BudgetQuarter,

    if(EmployeeBusinessEntityID = 'Website', -1, num#(EmployeeBusinessEntityID)) as Budgetholder

Resident SalesOrders2;

Concatenate (LinkTable)

load Distinct

    BudgetKey,

    BudgetYear,

    BudgetQuarter,   

    Budgetholder

Resident Budgets;

Tags (2)
1 Solution

Accepted Solutions
chauhans85
Esteemed Contributor

Link table results in synthetic key

try this

qualify * ;

Unqulify BudgetKey;

Load

BudgetKey,

    BudgetYear,

    BudgetQuarter,   

    Budgetholder

Resident Budget;

Unqualify*;

3 Replies
chauhans85
Esteemed Contributor

Link table results in synthetic key

try this

qualify * ;

Unqulify BudgetKey;

Load

BudgetKey,

    BudgetYear,

    BudgetQuarter,   

    Budgetholder

Resident Budget;

Unqualify*;

Link table results in synthetic key

Hi,

You have to link it with Budgetholder so unqualify Budgetholder  and reset of tables qualify

LinkTable:

load Distinct

    BudgetKey,

    year(AddMonths(OrderDate, $(vFiscalOffset))) as BudgetYear,

    ceil(month(AddMonths(OrderDate, $(vFiscalOffset)))/3) as BudgetQuarter,

    if(EmployeeBusinessEntityID = 'Website', -1, num#(EmployeeBusinessEntityID)) as Budgetholder

Resident SalesOrders2;

qualify * ;

Unqulify Budgetholder;

Load

BudgetKey,

    BudgetYear,

    BudgetQuarter,  

    Budgetholder

Resident Budget;

Unqualify*;

Rgds

Anand

michielvandegoo
Valued Contributor

Re: Link table results in synthetic key

its.anandrjs answer:

This resulted in 2 synthetic keys.

Despite that, thanks for the help

Community Browser