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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Concatenate Load issues

I have an issue where concatenate does not perform as i would expect, I'm looking to loop through a number of issues (50 which i've reduced to 2 for ease below) against a table (temp which contains circa 100k)

IssueMap:

Mapping LOAD * INLINE

[

ISSUENO, ISSUE

  1, A,

  2, B

];

FOR K = 1 to 2

V=ApplyMap('IssueMap',$(K));

IF

     $(K) = 1 Then

       TEST:

            LOAD

                 $(V) AS NEWIssue,

                 $(K) AS ROW

             RESIDENT TEMP

             ;

ELSE

       TEST:

            CONCATENATE

            LOAD

                 $(V) AS NEWIssue,

                 $(K) AS ROW

            RESIDENT TEMP

            ;

ENDIF

NEXT K

Based on the above I return this -

TEST.NEWIssue

TEST.ROWTEST-1.NEWIssueTEST-1.ROW
A1--
--B2

But would have expected / want to see this -

TEST.NEWIssueTEST.ROW
A1
B2

Where am i going wrong / why are -1 variants of the field names being generated?

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

Thanks for the posts.

Just realised i had a "Qualify" statement in an earlier load tab so when executing the script as the columns already existed when attempting to concatenate the -1 columns were auto generated

View solution in original post

5 Replies
Anonymous
Not applicable
Author

IssueMap:
Mapping LOAD * INLINE[
ISSUENO, ISSUE
1, A,
2, B
]
;

FOR K = 1 to 2
TEST:
LOAD
ApplyMap('IssueMap',$(K)) AS NEWIssue,
'$(K)'
AS ROW
AutoGenerate(1);
NEXT 

alexandros17
Partner - Champion III
Partner - Champion III

try this

IssueMap:

Mapping LOAD * INLINE

[

ISSUENO, ISSUE

  1, A,

  2, B

];

FOR K = 1 to 2

V=ApplyMap('IssueMap',$(K));

IF $(K) = 1 Then

       TEST:

            LOAD

                 $(V) AS NEWIssue,

                 $(K) AS ROW

             RESIDENT TEMP

             ;

ELSE

      

            CONCATENATE (TEST)

            LOAD

                 $(V) AS NEWIssue,

                 $(K) AS ROW

            RESIDENT TEMP

            ;

ENDIF

NEXT K

Not applicable
Author

Thanks for the posts.

Just realised i had a "Qualify" statement in an earlier load tab so when executing the script as the columns already existed when attempting to concatenate the -1 columns were auto generated

sasiparupudi1
Master III
Master III

Hi

If you are happy with the solutions given here, pl close this thread by marking any helpful and a correct answer.

MarcoWedel
MVP
MVP

besides your qualify issue I guess you could replace your loop with a join to improve the performance.

regards

Marco