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: 
absekrafi
Creator III
Creator III

Concatenate

Hi Qlikview experts,

I am new to Qlikview and I have an issue with "concatenate" function.

I sepearted the code of my concatenate function to a sepearte project, every thing work perfecly but when I merge the "concatenate" code in to my project some fields have null values. the fields are CODUSN, TRANSACTION_DATE, CODEART, CODESART, ....

Enclosed the code (it is the same in both cases) but the result is different:

Directory;

PRODUCTION_REDRESS:

LOAD CODEART,

     CODESART,

     CODUNT,

     CODUSN,

     DATPROD AS TRANSACTION_DATE,

     OBSERVATION,

     QTEPROD,

     STOCKFM,

     STOCKFNM,

     STOCKPHY,

     TYPEART

FROM

[..\QVD\PRODUCTION.qvd]

(qvd);

Directory;

CONCATENATE (PRODUCTION_REDRESS)

LOAD

CODPROD AS CODEART,

CODESART,

     CODU AS CODUNT,

     CODUSN,

     DATRED AS TRANSACTION_DATE,

     QTERED AS QTEPRODRED

FROM

[..\QVD\REDUSN_U.qvd]

(qvd);

STORE PRODUCTION_REDRESS into [..\QVD\PRODUCTION_REDRESS.qvd] (qvd);

DROP Table PRODUCTION_REDRESS;

Directory;

PRODUCTION_REDRESS:

LOAD CODEART,

     CODESART,

     CODUNT,

     CODUSN,

     TRANSACTION_DATE,

     OBSERVATION,

     QTEPROD,

     STOCKFM,

     STOCKFNM,

     STOCKPHY,

     TYPEART,

     QTEPRODRED,

     NumSum(QTEPRODRED, QTEPROD) AS QUANTPROD

FROM

[..\QVD\PRODUCTION_REDRESS.qvd]

(qvd);

STORE PRODUCTION_REDRESS into [..\QVD\PRODUCTION_REDRESS.qvd] (qvd);

Please help to understand why these fields have empty values.

Thank you in advance,

Kind regards.

Abdallah

1 Solution

Accepted Solutions
shiveshsingh
Master
Master

You are using forced concatenation, the fields which are showing null may not have data corresponding to your QTEPREDRED field. can you share your app to debug?

View solution in original post

13 Replies
shiveshsingh
Master
Master

You are using forced concatenation, the fields which are showing null may not have data corresponding to your QTEPREDRED field. can you share your app to debug?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If you use CONCATENATE to attach a second table to a first table, then a problem exists when the field lists of both tables do not match. QlikView resolves this by assuming fields with NULL values when those fields aren't explicitly specified.

For example, if I have Table1 consisting of fields A, B & C and I CONCATENATE Table2 consisting of fields A, D & E to Table1, then the resulting table will end up having fields A, B, C, E & A for all rows. The rows that were originally from Table1 will have NULL values for all D & E fields, and the rows that were originally from Table2 will have NULL values in fields B & C.

This clearly demonstrates that within the same table, a database engine (from QV or any RDBMS) cannot really have some columns missing in some rows, while they are available in some other rows. All rows must have the same number and type of columns. But some of them may be empty...

absekrafi
Creator III
Creator III
Author

Enclosed the code and the Tables. Thank you in advance.

absekrafi
Creator III
Creator III
Author

I have CODUSN common to both Tables.

For the other columns I renaimed some of them.

What I don't understand is why when I copy the code I posted to a new Qlikview project the concatenation works?

absekrafi
Creator III
Creator III
Author

could you please explain to me how to debug the application?

I will try from my side also.

Thank you

shiveshsingh
Master
Master

Hi, what are the expressions and dimensions for your chart?

absekrafi
Creator III
Creator III
Author

Right now I am displaying the output in simple table.

Once my table get redressed, the dimensions of my chart will be CODUSN, PRODUCT_TYPE (based CODEART and CODESART) and Sum(QUANTPROD)

shiveshsingh
Master
Master

Hi

What is the reason behind concatenating these tables?

Your QTEPRODRED(Present in second table) is not having values corresponding to other fields in first table.

absekrafi
Creator III
Creator III
Author

Hi Shivesh,

I have 2 tables (PRODUCTION and REDUSN_U). The second is table contains corrections of quantity produced.

Both tables have in common:

CODUSN: factory code

CODUNT: unit code

CODEART: article code

CODESART: sub-article code

I want to concatenate the 2 tables in order to get in one table the original production values  plus the rectification in order to display the result in a chart