Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
girish_talele
Creator
Creator

SQL SELECT with - Where condition from Resident Table

Dear Experts,

Below given condition will work in resident table but

Is there any way to map below requirement in SQL SELECT from SAP database.

//===============================================================

Emp:

Load * INLINE [

    Emp, Ind

    30000000, Yes

    30000001, Yes

];

//===============================================================

SAP_Data:

LOAD

PERNR AS Employee,

NACHN AS Surname;

SQL SELECT PERNR NACHN FROM PA0002 Where ApplyMap('Emp', PERNR,'No') = 'Yes';

//===============================================================

1 Solution

Accepted Solutions
amartinez35
Partner
Partner

Hi,

You can try :

Emp:

Load * INLINE [

    Emp, Ind

    30000000, Yes

    30000001, Yes

];

SUPERTEST:

LOAD

  Concat(Emp, ',') as TEST

Resident Emp

Where Ind='Yes'

;

LET vTest = Peek('TEST', 0, 'SUPERTEST');

SAP_Data:

LOAD

PERNR AS Employee,

NACHN AS Surname;

SQL

  SELECT PERNR NACHN

  FROM PA0002

  WHERE  PERNR  in ($(vTest))

;

drop table SUPERTEST;

View solution in original post

5 Replies
yduval75
Partner
Partner

ApplyMap is a Qlikview Function. It must operate ine the Qlikview instruction.

Moreover you have to specify Mapping Load in your Map instruction

Emp:

Mapping

Load * INLINE [

    Emp, Ind

    30000000, Yes

    30000001, Yes

];

SAP_Data:

LOAD

PERNR AS Employee,

NACHN AS Surname

Where ApplyMap('Emp', PERNR,'No') = 'Yes'

;

SQL SELECT

  PERNR NACHN

FROM PA0002;

anbu1984
Master III
Master III

You cannot use Qlikview function in Sql. Either you have to hardcode in Sql or you can use ApplyMap() on Preceding Load

LOAD

PERNR AS Employee,

NACHN AS Surname Where ApplyMap('Emp', PERNR,'No') = 'Yes';

SQL SELECT PERNR NACHN FROM PA0002 ;

amartinez35
Partner
Partner

Hi,

You can try :

Emp:

Load * INLINE [

    Emp, Ind

    30000000, Yes

    30000001, Yes

];

SUPERTEST:

LOAD

  Concat(Emp, ',') as TEST

Resident Emp

Where Ind='Yes'

;

LET vTest = Peek('TEST', 0, 'SUPERTEST');

SAP_Data:

LOAD

PERNR AS Employee,

NACHN AS Surname;

SQL

  SELECT PERNR NACHN

  FROM PA0002

  WHERE  PERNR  in ($(vTest))

;

drop table SUPERTEST;

View solution in original post

girish_talele
Creator
Creator
Author

Dear Aurélien MARTINEZ,

Thanks, it works (provided the no. of values in concat are few).

Regards,

Girish.

sidjustice
Contributor II
Contributor II

Any idea what is the limit on the number of values in concat?