Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

qlikhans
Contributor

resolve synthetic keys

Dear

Please see attached

I want to show in 1 QV document actuals versus budget. Actuals separately works, Budget separately works, Combining Actuals and Budget creates synthetic keys and does not work properly. I have tried to resolve by qualifying. However unqualifying to much leads to the same problem.

unqualifying for example ACCT_NO, results in budget data only up to the month of uploaded actuals.

I need to see reports by (at least) Entity, by ACCT and by Date.

Who can support me?

Tags (1)
1 Solution

Accepted Solutions
ahaahaaha
Honored Contributor

Re: resolve synthetic keys

I do not represent the content of your data, so I'm very much afraid to steer you on the wrong path. In the attached file, I brought all your data into one file. All comments in the script code. The script itself can only be used as a sample. For example, I joined the source tables Actual and COA with the left link, but I'm not sure if this is correct. Only you from the sense of your data can correctly collect them in one table.

I would be glad if something could help you.

Regards,

Andrey

14 Replies
awhitfield
Esteemed Contributor

Re: resolve synthetic keys

Morning Hans,

you can resolve this my creating a 'composite' key on both your Actuals and Budget tables. There's a worked example on the following post that should help you solve the issue:

how to create composite key

Best regards,

Andy

qlikhans
Contributor

Re: resolve synthetic keys

Dear Andrew,

Thank you for your answer. I have tried seveeral options, but have not been fully succesful up to now.

May I ask you to check my (attached) sample files and help me in getting it right?

t.u. in advance

Hans

qlikview979
Valued Contributor

Re: resolve synthetic keys

Are you expecting to remove syntactic in document.  what is the link column between this table

Re: resolve synthetic keys

From given qvw, Seems there is no Circumference Keys / Synthetic keys

Capture.PNG

qlikview979
Valued Contributor

Re: resolve synthetic keys

May be

Are Expecting like below  right


PFA

Untitled.png

qlikhans
Contributor

Re: resolve synthetic keys

Hi Anil,

t.u. for replying

the issue here is that after trying to resolve the synthetic keys, QV warns for ambigous results.

ahaahaaha
Honored Contributor

Re: resolve synthetic keys

Hi,

A pretty decent scheme, if only correctly linked tables (one to one and one to many). When organizing data, I usually try to plan/budget data and actual data in one table with a [budget] or [fact] flag.

Regards,

Andrey

mattquinnterex
Contributor II

Re: resolve synthetic keys

If you are getting synthetic keys it is because the tables have more than one way to reach each other. A table should only every have one foreign key within it; from looking at some of the photos shared, there are multiple columns that have the same name in other tables. One way to fix this is to rename them.

Do you have a sample data file?

qlikhans
Contributor

Re: resolve synthetic keys

Dear Mahesh,

similar. In the end my output requirement is to compare the actual with the budget:

for example    

Entity_NOACCT_NOSum(Amnt_ACT)Sum([Month Budget])difference

or   

RepNameCat3Sum(Amnt_ACT)Sum([Month Budget])difference

  or

Entity_NoCC_NAMESum(Amnt_ACT)

the (left,7) positions of ACCT_CC = ACCT_NO. So ACCT_CC is more detailed than ACCT_NO. In your input the connection between ACCT_CC and ACCT_NO appears not to exist.

WOuld establishing that connection be a further step in resolving my issue?

If so, could you help me with that?

t.u. in advance for your help