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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
HKN1
Contributor III
Contributor III

Two Table, Two Key, Two Date

I am trying to generate a generic date by concatenating the dates. But the amount totals, or quantity totals do not give the correct date.


I have tried every way (Link Table, concat table, fact table, calender table...), but without success.

There should be only 1 date instead of creadet_date and publish_date.

Can you help me?

Thank you.

 

HKN1_0-1723447928240.png

 

 

HKN1_1-1723447956185.png

 

Labels (1)
3 Replies
QFabian
MVP
MVP

Hi @HKN1 , one option is keep the tables renaming fields :

QFabian_0-1723474032045.png

Here the example script : 

Table_A:
Load * INLINE [
FOLDER_NO, created_date, folder_amount, folder_price
1,1,1,1    
];
  
Table_B:
Load * INLINE [
FOLDER_NO, FILE_NO, publish_date, file_amount, file_price
1,1,1,1   , 1
];
 
Table_A_New:
Load
FOLDER_NO as Folder_A,
created_date    as canonical_date,
folder_amount as Amount_Folder,
folder_price as Price_Folder
Resident Table_A;
 
Table_B_New:
Load
FOLDER_NO as Folder_B,
FILE_NO as File_No_Folder_B,
publish_date    as canonical_date,
file_amount as Amount_File,
file_price as Price_File
Resident Table_B;
 
 
 
 
drop table Table_A, Table_B;
exit script;
 
 

 
 
Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
QFabian
MVP
MVP

Hi again @HKN1 , another option is concatenating :

QFabian_1-1723474356645.png

 

Table_A:
Load * INLINE [
FOLDER_NO, created_date, folder_amount, folder_price
1,1,1,1    
];
  
Table_B:
Load * INLINE [
FOLDER_NO, FILE_NO, publish_date, file_amount, file_price
1,1,1,1   , 1
];
 
Data:
Load
FOLDER_NO as FOLDER_NO,
created_date    as canonical_date,
    'Folder' as Type,
folder_amount as Amount,
folder_price as Price
Resident Table_A;
concatenate
Load
FOLDER_NO as FOLDER_NO,
FILE_NO as FILE_NO,
publish_date    as canonical_date,
    'File' as Type,    
file_amount as Amount,
file_price as Price
Resident Table_B;
 
 
 
 
 drop table Table_A, Table_B;
exit script;
Greetings!! Fabián Quezada (QFabian)
did it work for you? give like and mark the solution as accepted.
HKN1
Contributor III
Contributor III
Author

does not work.
I do not get an error, but the total units that should be are incorrect.

Is there another way to do common times?

Thanks.