Can anyone please help me in calculating the average of below shown column. It is strange why QS is not able to calculate the average of a number field. I am using SQL server for data connection and uploading to QS Desktop via Data Manager. All the Null values are from Database table.
I can only able to calculate the count of the 'Rating' by giving the expression Count(Rating) as measures in KPI visualization.
If i will use excel data sheet for the same column then it is able to calculate average but not for my Data connection.
Thanks Sunny for your quick response, however it is not working. Just to update on this I just checked that the data type of my field in SQL DB is nvarchar(max). Is it because of the defined data type that QS is not able to calculate the char average.
So, i just quickly check any field with 'int' data type average is calculate.
Thanks Anil , It worked when I included the above expression in script editor.
Before I was only using Set NullValue = ''; which was not working for me.
Again I want to update you it due to nvarchar data type in my DB table column Rating which QS was not able to calculate the char average. when i changed the data type of Rating column to Float then i easily applied Avg(Rating) expression and it worked.
Because, VarChar() consider both (String + Digit) and Float (Only Digits). If, you are entering as NULL for missed numbers then varchar needed from DB side. If you are skipping that and using simple Float then it works.
Does it make sense?
Life is so rich, and we need to respect to the life !!!