cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
vmakhija Member
Member

Error in calc column for MEDIAN

Hello

 

I have this simple column for which I am trying to calcualte a MEDIAN value as below.

But it gives an error saying -- "Expressions that yield variant data-type cannot be used to defined calculated columns"

 

Any inputs on this?

 

MEDIAN.JPG

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Error in calc column for MEDIAN

hmm, for even number of items median can be decimal number even if it's based on Whole numbers.
can you try switching data type to Decimal with format as Whole?

6 REPLIES 6
Super User
Super User

Re: Error in calc column for MEDIAN

I'm not 100% sure, but I think that you need to change the data type of Column1 from Any to Number

vmakhija Member
Member

Re: Error in calc column for MEDIAN

@Stachu

Column1 is already of datatype "Whole Number"

Super User
Super User

Re: Error in calc column for MEDIAN

are you sure it's the data type and not format? they're just next to each other in the UI
unless you changed it in the query editor, then it must be something else - are there any non numeric values in that column?

vmakhija Member
Member

Re: Error in calc column for MEDIAN

@Stachu

Yup, both are "Whole Number". See below -

 

 

FORMAT.JPG

 

 

 

 

 

 

There are no non-numeric values in this column. My earlier screenshot shows all the values available for this column.

 

Super User
Super User

Re: Error in calc column for MEDIAN

hmm, for even number of items median can be decimal number even if it's based on Whole numbers.
can you try switching data type to Decimal with format as Whole?

vmakhija Member
Member

Re: Error in calc column for MEDIAN

@Stachu, that helped Smiley Happy

Now I think of it, it was so silly one to not think of.