Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
meetmrudul
Contributor II

Concatenation for Measures in Direct query for Postgresql

Hi All,

As per heading of the discussion, I want to concatenate string values in two different columns of Measures in Direct Query.

How Can I achieve the same.

I am using Postgresql.

I am using -

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  col2,

  col3

From demo;

And I want something like -

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  col2 || col3 as test

From demo;

Please assist.

Thanks & Regards,

MK

1 Solution

Accepted Solutions

Re: Concatenation for Measures in Direct query for Postgresql

I see no documentation where it says that you cannot use NATIVE in Measures. But there is no way for me to test this because I don't have access to Direct Discovery application. But just so we are sure, did you add single quotes around your function?

NATIVE( 'col2 || col3' ) as test

15 Replies
adamdavi3s
Honored Contributor

Re: Concatenation for Measures in Direct query for Postgresql

Can you preceeding load a direct query?


Load *,col2 & col3 as test;

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  col2,

  col3

From demo;



meetmrudul
Contributor II

Re: Concatenation for Measures in Direct query for Postgresql

I tried this, it says, col2 not found, throws an error.

adamdavi3s
Honored Contributor

Re: Concatenation for Measures in Direct query for Postgresql

sack off the direct query and just use normal SQL?

I never really understood the benefit of direct query myself

meetmrudul
Contributor II

Re: Concatenation for Measures in Direct query for Postgresql

anyone please assist

adamdavi3s
Honored Contributor

Re: Concatenation for Measures in Direct query for Postgresql

Sorry I was being serious, I don't think you can expect to achieve this using DIRECT Query as it doesn't give you this kind of flexibility

meetmrudul
Contributor II

Re: Concatenation for Measures in Direct query for Postgresql

I have to use Direct Discovery approach only

Re: Concatenation for Measures in Direct query for Postgresql

Can you try this:

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  NATIVE(col2 || col3) as test

From demo;

Re: Concatenation for Measures in Direct query for Postgresql

Here are some example of how NATIVE is used. It basically allows you to do SQL manipulations to the Direct Discovery

What is QlikView Direct Discovery – Learn QlikView

Re: Concatenation for Measures in Direct query for Postgresql

Forgot to add single quotes....

DIRECT QUERY

DIMENSION

  1 As Flag

MEASURE

  col1,

  NATIVE( 'col2 || col3' ) as test

From demo;