Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear QFabian
May be you are too busy to answer above queries but I have resolved them today.
Many Thanks, Tracy
Hi @tracycrown , try this, it will create a union table, using a composite field, and the desired fields :
Qlik Help about synthetic keys.
For the drill down, check this about groups :
Script:
Receiving:
LOAD
Part# &' | ' & Date as %_Key,
Invoice# as P_Invoice#,
Quantity as P_Quantity,
Total as P_TotalAmt,
Unit_Cost,
Vendor#
FROM
[Test Data.xlsx]
(ooxml, embedded labels, table is Receiving);
Issuing:
LOAD
Part# &' | ' & Date as %_Key,
Invoice# as S_Invoice#,
Quantity as S_Quantity,
Total as S_TotalAmt,
Unit_Price,
Customer#
FROM
[Test Data.xlsx]
(ooxml, embedded labels, table is Issuing);
Union_Aux:
Load distinct
%_Key
Resident Receiving;
Load distinct
%_Key
Resident Issuing;
Union:
Load distinct
%_Key,
subfield(%_Key, ' | ', 1) as Part#,
date(subfield(%_Key, ' | ', 2)) as Date,
year(subfield(%_Key, ' | ', 2)) as Year,
quartername(subfield(%_Key, ' | ', 2)) as Quarter,
Month(subfield(%_Key, ' | ', 2)) as Month,
day(subfield(%_Key, ' | ', 2)) as Day
Resident Union_Aux;
drop table Union_Aux;
Dear QFabian
Thank you so much for your quick response.
I do not understand why YEAR (Subfield(%_Key) for Quarter, Month and Day
date(subfield(%_Key, ' | ', 2)) as Date,
year(subfield(%_Key, ' | ', 2)) as Year,
year(subfield(%_Key, ' | ', 2)) as Quarter,
year(subfield(%_Key, ' | ', 2)) as MOnth,
year(subfield(%_Key, ' | ', 2)) as Day
Resident Union_Aux;
Also, it looks funny to replace Part# with % Key, see attached below.
@tracycrown Please check the updated post.
The fields where recreated in the UNION table.
It supossed to be year, quarter, month and day functions, i forgot to do that
Dear QFabian
Thank you so much for your clarification. Please note that quarter no working :
Quarter(subfield(%_Key, ' | ', 2)) as Quarter,
Thanks, Tracy
quartername
Dear QFabian
Please help to answer the following :
1. May I know why 1st row for Part# is blank
2. How to change Quartername (Jan-Mar 2021) to Q1-2021
Thank you, Tracy
Dear QFabian
May be you are too busy to answer above queries but I have resolved them today.
Many Thanks, Tracy