Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Talk to Experts, a LIVE Q&A Webinar. Bring your Qlik Sense Business questions on Aug. 4th. Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

Autonumber issue

I am trying to remove the synthetic key using Autonumber function..I have created Autonumber key in two tables using three columns Fox Ex- Autonumber(Date&'-'&X&'-'Y) as key..Two tables are connected through the key column but it is generating different keys for same value.Am I doing anything wrong here?

9 Replies
Highlighted
Partner
Partner

make sure your date field doesnt have any time values.

i dont see any other issues.

can you share some sample data

Highlighted
Contributor III
Contributor III

I have used date(datefield,'YYYY-MM-DD').

For first table say 

Table x:

Autonumber(Date&x&Y)--> key generates values from '1' to '6588'

for second table 

Table y:

Autonumber(Date&x&Y)--> key generates values from '6589' to '1100000'

Highlighted
Partner
Partner

try flooring datefield

date(floor(datefield),'YYYY-MM-DD')

Highlighted
Partner
Partner

You need to use a parameter in the AutoNumber Function to let Qlik Sense know you are wanting to use the same AutoNumber 'Set' for each table loaded.

AutoNumber(Date & '-' & X & '-' Y, 'a') as KeyField

The letter 'a' can be anything you want it to be as long as you use the same parameter is all load statements.

TableA:

Load 

AutoNumber(Field1 & Field2 & Field3, 'a') as KeyField

From SourceA;

TableB:

Load 

AutoNumber(Field4 & Field5 & Field6, 'a') as KeyField

From SourceB;

Highlighted
Contributor III
Contributor III

It dint work..

Highlighted
Partner
Partner

Does it work if you don't use the AutoNumber function?

i.e.

TableA:

Load

Field1 & FIeld2 & Field3 as KeyField

From SourceA;

TableB:

Load

Field4 & Field5 & Field6 as KeyFIeld

From SourceB;

 

Highlighted
Contributor III
Contributor III

I have used AutoNumber(Date & '-' & X & '-' Y, 'a') as KeyField but still, it generates different numbers because of that table join doesn't happen

 

Highlighted
Partner
Partner

What does X and Y represent?

Do you have an exact example of the script for this Load Statement?

Highlighted
Contributor III
Contributor III

It worked. Thanks for all your response 

I used Autonumber(Date(Date,'ÝYYY-MM-DD'& X&Y) as key