Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

My expression keeps returning null

Hello

I am stuck trying to get an average satisfaction code (rating 1 to 5) taken from the salesperson that sold the order for each type of return reason codes.

I am using return reason code as dimension.

I managed to get the total count of the return reasons with the expression: count(RETURN_return_code)

The line I am trying to use to get the average satisfaction code per return reason code is:

sum(SATISFACTION_TYPE_code) / count(RETURN_return_code)

I also tried with avg(SATISFACTION_TYPE_code), but all I'm getting back is null values.

Thanks in advance, I can also add a file if neccesary

6 Replies
tresesco
MVP
MVP

Attach the file please.

Anonymous
Not applicable
Author

Does SATISFACTION_TYPE_code associate to the Reason Code that you are using as you dimension ?

If you create three list boxes of SATISFACTION_TYPE_code, RETURN_return_code and Reason_Code, do selections in one effect the other ?

Jonathan

sujeetsingh
Master III
Master III

it is surpeising behaviour ....Plz provide a sample .

Not applicable
Author

there is a link table that connects them, though indirectly. When I try to use the list boxes the satisfaction type code is not affected.

Every returned order is linked to an order, which is sold by a sales_staff, which has satisfaction type code values. Is there any way to make this link manually without using the script function?

PS: added the file

tresesco
MVP
MVP

Your data is wrong:

table.bmp

There is no RETURN_REASON_Code against SATISFACTION_TYPE_code, so the expression Sum(SATISFACTION_TYPE_code) could produce nothing against the dimension RETURN_REASON_Code.

Hope it explanins why returns null.

Thanks.

Not applicable
Author

Yes I figured out it wasn't going to work. I worked around it by using a list box and manually clicking. I cannot make it nicely presentable but at least I can use the data for my conclusion.

Thanks for the help anyways, much appreciated!