# Snowflake scalar udf in dbt

**URL:** <https://discourse.getdbt.com/t/snowflake-scalar-udf-in-dbt/10182>\
**Category:** Help\
**Tags:** jinja, snowflake, dbt-cloud, macros\
**Created:** [October 2, 2023, 11:01am UTC](https://discourse.getdbt.com/t/snowflake-scalar-udf-in-dbt/10182 "2023-10-02T11:01:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranpy321](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/kiranpy321/32/3055_2.png) [@kiranpy321](https://discourse.getdbt.com/u/kiranpy321)\
**Post date:** [October 2, 2023, 11:01am UTC](https://discourse.getdbt.com/t/snowflake-scalar-udf-in-dbt/10182/1 "2023-10-02T11:01:47Z")

</div>

Hii there,

I was trying to write a snowflake scalar udf in dbt .

I am having issue in creating snowflake udf which returns float value

The udf has to get query result from three different tables and based on each query result has to be passed to another query to get another query output .

Here i am trying to replace the Sqlserver function to snowflake scalar udf .
