Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to do calculations for such table

CleanlinessDoctors attitudeNurse AttittudePharmacy ServicesMean A
752035100(75+20+35+100) / 4
100-10050(100+100+50)/3
50501000(50+50+100+0)/4
100-7550(100+75+50) / 4
=(75+100+50+100) / 4(20+50) / 2(35+100+100+75) / 4(100+50+0+50)/4

When i generate the script i get the following table without last row and column.

1) How can i add column "Mean A" to the table??

2) What formula i can use to calculate the last raw values??

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Yes, you're creating new fields (like Satisfaction Score), but those fields don't exists yet as far as rangeavg knows. So you either need to use the same expressions in the rangeavg function (i.e. write them out) or use a precedent load so you can use the new fields:

SummaryTable:

load *, rangeavg([Satisfaction Score],[Admission Score],[Nursing Care Score]) as MeanA;

load *,
ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score],
ApplyMap('Admission Score',[Admission / registration process]) * Count as [Admission Score],
ApplyMap('Nursing Care Score',[Nurses Courtesy]) * Count as [Nursing Care Score],
Resident Surveys;



talk is cheap, supply exceeds demand

View solution in original post

8 Replies
sujeetsingh
Master III
Master III

plz explain .....in details  with table structure

Not applicable
Author

what i mean how i get the caculation at end of each raw and each column

Gysbert_Wassenaar

Use the avg() function for the first four metrics and rangeavg(Cleanliness,[Doctors attitude],[Nurse Attittude],[Pharmacy Services]) for Mean A. See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

This is great,

but say i have the script as follow:

[Survey]:

LOAD
    Cleanliness,

    Doctors attitude

    Nurse Attittude,

    Pharmacy Services

from table


and i want to add this formula to the script

rangeavg(Cleanliness,[Doctors attitude],[Nurse Attittude],[Pharmacy Services])

Gysbert_Wassenaar

Just add it then

[Survey]:

LOAD
    Cleanliness,

    Doctors attitude

    Nurse Attittude,

    Pharmacy Services,

   rangeavg(Cleanliness,[Doctors attitude],[Nurse Attittude],[Pharmacy Services]) as MeanA

from table


talk is cheap, supply exceeds demand
Not applicable
Author

OKKI Cool but what if the script was

Load



*,



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

ApplyMap('Admission Score',[Admission / registration process]) * Count as [Admission Score],

ApplyMap('Nursing Care Score',[Nurses Courtesy]) * Count as [Nursing Care Score],



rangeavg([Satisfaction Score],[Admission Score],[Nursing Care Score]) as MeanA

  

Resident Surveys;

It will give an error satisfcation score does not exist.

This is the idea i want to reach

Gysbert_Wassenaar

Yes, you're creating new fields (like Satisfaction Score), but those fields don't exists yet as far as rangeavg knows. So you either need to use the same expressions in the rangeavg function (i.e. write them out) or use a precedent load so you can use the new fields:

SummaryTable:

load *, rangeavg([Satisfaction Score],[Admission Score],[Nursing Care Score]) as MeanA;

load *,
ApplyMap('Satisfaction Score',[Overall Experience]) * Count as [Satisfaction Score],
ApplyMap('Admission Score',[Admission / registration process]) * Count as [Admission Score],
ApplyMap('Nursing Care Score',[Nurses Courtesy]) * Count as [Nursing Care Score],
Resident Surveys;



talk is cheap, supply exceeds demand
Not applicable
Author

Thnx .

An extra question

the script generate table

column1      column2    column3

  1                   2                   3

  3                   -                    1

  -                    4                   2

now i want to substitute the missing value with the average of each column its in, to get such table

column1      column2    column3

  1                   2                   3

  3                   3                    1

  2                    4                   2