Embedding excel formula in MS Query that will be evaluated in excelnot in the SQL server

H

hpatino

I have a MS-QUERY that retrieves 4 columns from an SQL server. I want to create a fith column that is evaluated as formula in excel, not in the SQL server

The fith column should compare column 4 with the value on an excel function (in this case percentile):

=if(column4 > percentile(sheet1!ReferenceName, 0.25), 1, 0 )

I have two options
- Create a manual formula everytime the data is refreshed from the server
- Using vba to trap the Query AfterRefresh event, then get a range of the fifth column and update every cell formula

However, i want to know if is posible to create a retrieve data using MS-query that is only evaluated in excel and not treated as string nor evaluated in the SQL server. Something like this

Select col1, col2, col3, col4, '=if(col4>percentile(param1, 0.25),1,0)' from Table
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top