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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt
Specialist
Specialist

Concatenate Issue

Hello,

I have many tables with Branches and different periods. For concatenate them Im using Autonumber Fuction but When QlikView concatenate the tables the results are differents that when I load QVDs Separately. I left an example file with Oct 2012. The real result in my Qvd is 22.262.560. The example Rec Castigo Gives me Diferent 8876479.

Thank you!

7 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

If I remember correctly the autonumber function only guarantee unique values for anything processed during execution of the load script. The counter is reset to 1 on every reload. So it could well generate different numbers for the same concatenation in different reloads. You should not store autonumber keys in the qvd if you create the qvd's separately. Store the original data in the qvd's and create the autonumber keys when you load the qvd's.


talk is cheap, supply exceeds demand
pgalvezt
Specialist
Specialist
Author

Thank you for your reply,

I stored the original data in my Qvds. And the I create the autonumber inside the Qvds created. If I understood well you mean that I Should be create the autonumber before of store?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

No, you shouldn't store it at all. Only calculate it for joining the tables, don't store it.


talk is cheap, supply exceeds demand
pgalvezt
Specialist
Specialist
Author

Could you please give an example. I really I don't understand good this issue.

Thanks!

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Sales:

select * from mydb.mysalestable;

store Sales into Sales.qvd (qvd);

drop table Sales;

SalesFact:

LOAD * FROM Sales.qvd (qvd);

JOIN (SalesFact)

LOAD DISTINCT

          CustomerID,

          CompanyID,

          AutoNumber(CustomerID & '|' & CompanyID, 'Customer') as %SalesKey

RESIDENT SalesFact;


talk is cheap, supply exceeds demand
pgalvezt
Specialist
Specialist
Author

If you look at the sample that I put here. You can see that I have the same structure that your example. Just that Im using concatenate. look at the sheet "Union2".

pgalvezt
Specialist
Specialist
Author

Hi, I used Join and Left Join but I still having the same result. Any Ideas?

Thank you!