Question on Custom Functions and Datatype Argument

Dean Flinter shared this question 20 months ago
Completed

Hi,

We have a custom function added that has 3 fields the user must select/define

In the XML of the function we have not specified a datatype for one of the fields but Yellowfin has decided it must be text. This means we cannot use the function on certain fields in the view

The return for the function itself is text so am wondering if Yellowfin is defaulting to text because of this?

If so or if this is just expected behaviour for any field that does not have a datatype, how do we allow any type? Can we specify multiple datatypes for a field in the XML?

We're using v9.8.1.2


Thanks

Dean

Replies (11)

photo
1

Hi Dean,

Thanks for reaching out to Yellowfin support.

1. If we don't specify a datatype for a field in XML of a custom function, it determines that the default data type is text format. This kind of behavior is expected for any field that doesn't have a data type specified.
2. We can't specify multiple data types for a single filed in XML file. Instead , we can use Object data type to allow any data type
https://wiki.yellowfinbi.com/display/user80/Custom+Functions

Please let me know if you need any assistance. I would be happy to do so

Regards,

Sri Vamsi

photo
1

Hi Sri,

Can you elaborate a little on #2? Are you just re-iterating that we can only have 1 type at a time and can use the <datatype> object to accomplish that?

Also, I just want to check something else that I noticed when trying to get around this problem.

In the view itself, I created a calculated field, using freehand sql, to cast the numeric data to char. However, despite Yellowfin seeing this as text and it looking like any other text field, I cannot select this field in the custom function.

It seems that only columns pulled from the database as text in the first place are allowed. Can you confirm if this is expected behaviour?


Thanks

Dean

photo
1

Hi Dean,

We can use datatype objects to indicate appropriate data types for each field in an XML file, but they can only handle one unique type at time. On the other hand, using an Object Data Type enables the specificity-free entry of many types of information. If computed fields are still seen by Yellowfin as numeric after being converted to text format, customized functions cannot use them; this problem must be fixed by using the CAST function and performing an explicit conversion.

However if you want to specify multiple data file you can specify individually as mentioned below.

b043d0ad9a1eb9be12a1426bf3b18ead

Regards,

Sri Vamsi

photo
1

Hi Dean,

I just want to touch base to see if you had chance to read through my response. If you can let me know that would be great.

Regards,

Sri Vamsi

photo
1

Hi Dean,

Hope things are good on your end. Just wanted to check in to make sure you had what you needed here.

Regards,

Sri Vamsi

photo
1

Hi,

Apologies, had meant to reply sooner

I'm happy enough with your explanation, thanks

However I'd like to make an enhancement request that arguments in custom functions can have either multiple defined datatypes or if the <datatype> object is not specified that any data type is accepted in the formula builder

There are many SQL functions that can take multiple data types. In my case, the Snowflake LISTAGG function was the one I was trying to use. Having to convert all non-text fields to text, just to use the custom function is tedious


Thanks

Dean

photo
1

Hi Dean,

Thanks for your reply.

I'll share the details with our product team. I'll let you know if this raised as an Enhancement Request on your behalf with the Product Team for further review.

Such requests will be reviewed by our Product Team and implemented based on feasibility,

level of positive impact on the user experience, and votes from the community.


Could you please allow me to mark this ticket as completed as of now?

Regards,

Sri Vamsi

photo
1

Hi Dean,

I just want to touch base to see if you had chance to read through my response. If you can let me know that would be great.

Regards,

Sri Vamsi

photo
1

Hi,

Yes you can close the ticket for now.

Please let me know what the product team say


Thanks

Dean

photo
1

Hi Dean,

Sure, thanks for the reply, I'll go ahead and mark this ticket as completed. Have a great rest of your day.

Regards,

Sri Vamsi

photo
1

Hi all,

I would also like to add my support for this request. Currently I am using the "Geometry" datatype to be able to access all datatypes as a workaround, but this restricts using the freetext box in the string selector. It would be good if we could leave datatype blank or "ANY" and let the SQL function determine if there are any problems. Like Dean said, there are many SQL functions that can take multiple data types.

Thanks

Leave a Comment
 
Attach a file