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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
arusiva89
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
dplr-rn
Partner - Master III
Partner - Master III

make sure your date field doesnt have any time values.

i dont see any other issues.

can you share some sample data

arusiva89
Contributor III
Contributor III
Author

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'

dplr-rn
Partner - Master III
Partner - Master III

try flooring datefield

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

whiteymcaces
Partner - Creator
Partner - Creator

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;

arusiva89
Contributor III
Contributor III
Author

It dint work..

whiteymcaces
Partner - Creator
Partner - Creator

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;

 

arusiva89
Contributor III
Contributor III
Author

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

 

whiteymcaces
Partner - Creator
Partner - Creator

What does X and Y represent?

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

arusiva89
Contributor III
Contributor III
Author

It worked. Thanks for all your response 

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