Qlik Community

QlikView Publisher

Discussion Board for collaboration on QlikView Publisher.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

mapping sql statement in qlikview script

Hi,

Can any one please explain me what does "sql select" do in qlikview ?

I'm editing one qvw file where I see statements like following

Colg_Stud:

mapping  sql select rtmt_id,rtmt_name from Colg_Stud;

I tried checking on net but could not get anything so thought of asking here.

Thanks in advance!!!

Tags (3)
1 Solution

Accepted Solutions
MVP
MVP

Re: mapping sql statement in qlikview script

Hi Kavita,

The below statement loads rtmt_id and rtmt_name from SQL table and it loads it into qlikview as Mapping Load table.  Generally mapping load is used to get value by passing the key(ID) of the value using ApplyMap().  Please check example below

Colg_Stud:

mapping  sql select rtmt_id, rtmt_name from Colg_Stud;

Example from Qlikview Help file:

Examples:

// Assume the following mapping table:

map1:

mapping load * inline [

x, y

1, one

2, two

3, three ] ;

ApplyMap ('map1', 2 ) returns ' two'

ApplyMap ('map1', 4 ) returns 4

ApplyMap ('map1', 5, 'xxx') returns 'xxx'

ApplyMap ('map1', 1, 'xxx') returns 'one'

ApplyMap ('map1', 5, null( ) ) returns NULL

ApplyMap ('map1', 3, null( ) ) returns 'three'


4 Replies

Re: mapping sql statement in qlikview script

Hi,

     Sql is used when you want to fetch data from database.

     The help says.

     The SQL statement allows you to send an arbitrary SQL command through an ODBC or OLE DB connection.

Regards,

Kaushik Solanki

MVP
MVP

Re: mapping sql statement in qlikview script

Hi Kavita,

The below statement loads rtmt_id and rtmt_name from SQL table and it loads it into qlikview as Mapping Load table.  Generally mapping load is used to get value by passing the key(ID) of the value using ApplyMap().  Please check example below

Colg_Stud:

mapping  sql select rtmt_id, rtmt_name from Colg_Stud;

Example from Qlikview Help file:

Examples:

// Assume the following mapping table:

map1:

mapping load * inline [

x, y

1, one

2, two

3, three ] ;

ApplyMap ('map1', 2 ) returns ' two'

ApplyMap ('map1', 4 ) returns 4

ApplyMap ('map1', 5, 'xxx') returns 'xxx'

ApplyMap ('map1', 1, 'xxx') returns 'one'

ApplyMap ('map1', 5, null( ) ) returns NULL

ApplyMap ('map1', 3, null( ) ) returns 'three'


Not applicable

Re: mapping sql statement in qlikview script

Hi Kaushik,

What does mapping key word do here ??

Thanks

Not applicable

Re: mapping sql statement in qlikview script

Thank a lot jagan

Community Browser