Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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!!!

1 Solution

Accepted Solutions
jagan
Luminary Alumni
Luminary Alumni

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'


View solution in original post

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

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

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
jagan
Luminary Alumni
Luminary Alumni

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
Author

Hi Kaushik,

What does mapping key word do here ??

Thanks

Not applicable
Author

Thank a lot jagan