Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

mapping not working

I have the following tabs in script:

tab1:

[Location list]:

LOAD [Department survey],

    
Locations

FROM

[..\Data\EXCELs\Bilal-Mafraq locations.xlsx]

(
ooxml, embedded labels, table is Locations);

Tab 2:

[Surveys]:

LOAD 1 as Count,

    
Locations,

      [Q10.1. Please rate your overall experience with us:]as [Overall Experience],

FROM

[..\Data\EXCELs\Bilal-Mafraq inpatient (Feb mach).xlsx]

(
ooxml, embedded labels, table is Sheet1);

Tab 3:

[Satisfaction Score]:

mapping LOAD * INLINE [

    Overall Satisfaction, Weight

    Satisfied, 100

    Extremely Satisfied, 100

    Neutral, 100

    Extremely Dissatisfied, 100

    Dissatisfied, 100

]
;

Tab 4:

[Surveys]:

Load

*,

ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score];

When i Execute the code the table appear but the new mapping column (Satisfaction Score) doesnt appear.

Anybody have an idea what might be wrong? is it the order of the tabs or the apply mapping thing!!!!!!!

PLEASE HELP AS SOON AS POSSIBLE

1 Solution

Accepted Solutions
swuehl
MVP
MVP

On your mapping tab in the script editor, you are commenting out some tables using

/*

[Promoter Score]:

Mapping LOAD * INLINE [

    Promoter Score, PromoWeight

    Yes, 100

    No, 0

];

...

There is no */ to end the comment part, so your complete tab ApplyMapping is still commented out (when you run the script, the script editor seems to show this part as not commented out, due to the new tab).

View solution in original post

7 Replies
swuehl
MVP
MVP

This is not a meaningful load statetement, you are missing the source:

[Surveys]:

Load

*,

ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score];

It will not produce a script error, though.

I assume you want to re-use the data from your surveys table, so try:

[SurveysResult]:

Load
*,
ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score]

Resident Surveys;

drop table Surveys;

(there is also a comma in your tab 2 load (after [Overall Experience]) that needs to be removed)

Hope this helps,

Stefan

Not applicable
Author

I tried this even it didnt work.

Not applicable
Author

i dont know if we should define * in

[SurveysResult]:

Load
*,
ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score]

Resident Surveys;

drop table Surveys;

alexpanjhc
Specialist
Specialist

when you put the 3 together, the qlikview may concatenate all together.

just add noConcatenate between the tables.

swuehl
MVP
MVP

If you want to keep your existing fields, the current load statement should be ok.

This script snippet works just fine for me:

[Surveys]:

LOAD 1 as Count,

//     Locations,

  [Overall Experience]

INLINE [

Overall Experience

Satisfied

Neutral

];

[Satisfaction Score]:

mapping LOAD * INLINE [

    Overall Satisfaction, Weight

    Satisfied, 100

    Extremely Satisfied, 100

    Neutral, 100

    Extremely Dissatisfied, 100

    Dissatisfied, 100

];

[SurveysResult]:

Load

*,

ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score]

Resident Surveys;

 

drop table Surveys;

I don't think your Locations table is important for your issue, so I left it out in my sample.

Could you maybe upload a small sample QVW that demonstrate your issue?

(or your [..\Data\EXCELs\Bilal-Mafraq inpatient (Feb mach).xlsx] file?)

Not applicable
Author

I attached the file, This may help understand whats going wrong. I need the mapping to appear in the same survey table. So all as one.

Thanx all for your help i appreciate

swuehl
MVP
MVP

On your mapping tab in the script editor, you are commenting out some tables using

/*

[Promoter Score]:

Mapping LOAD * INLINE [

    Promoter Score, PromoWeight

    Yes, 100

    No, 0

];

...

There is no */ to end the comment part, so your complete tab ApplyMapping is still commented out (when you run the script, the script editor seems to show this part as not commented out, due to the new tab).