Custom Functions
Post any examples of custom functions in this forum
Adjusting a Charachter Date/Time field to add or subtract 1 hour
Forums
I have imported a Date/Time field from an outside source and need to add 1 hour to the time to compare CST against EST. The field is formatted as Character/19 and contains YYYY-MM-DD HH:MM:SS.
I'm sure there must be a simple solution to add or subtract hours from a Date/Time to adjust for different timezones but I can't find it. Can you help?
Contains Keyword (from) File
Forums
The financial auditors in my office needed a way to search for a variety of keywords in a field of a dataset. The needed different keywords for different tests. They also wanted to see which keyword matched in its own column.
Usage:
#Contains_Keyword_File( SEARCHFIELD, "filename.txt" )
- Read more about Contains Keyword (from) File
- 1 comment
- Log in or register to post comments
Ceiling with significance
Forums
The ceiling with significance returns number rounded up, away from zero, to the nearest multiple of significance. For example, if you want to avoid using pennies in your prices and your product is priced at $4.42, use the formula =Ceiling(4.42,0.05) to round prices up to the nearest nickel.
- Read more about Ceiling with significance
- Log in or register to post comments
Appending a field with a result of more thn 6 decimals
Forums
What is teh best way to get a calculated result within a column with more than 6 decimal.
I have a column and i need to devide the amounts in that column by 0.1234564879 and need teh results of delimal atleast 15 digits. . When i tried this, i am getting teh results as 0.00 as the digits are more than 6 and till 6 digits, most of the values are zeros. I can not change any fields into thousands or millions. Please let em know if this can be possible.
Thanks,
Bibin
How to use filter contains the list of words (60 keywords)
Forums
Hi Team,
Please guide me how I can filter for contins of list of words in specific field.
I have already used the isin function however it can be use for 4-5 times. I need to find the 60 keywods in one specific field pls suggest the appropriate function in IDEA.
Regards
Nilesh
showFormat
Forums
This custom function will show you the format of a character field. It will change 0 to 9 to "9", uppercase characters as "X" and lowercase characters as "x". All other characters will stay the same.
Here are a couple of examples:
- #showFormat("ABCDEF") = "XXXXXX"
- #showFormat("12345") = "99999"
- #showFormat("Invoice 345/34-45") = "Xxxxxxx 999/99-99"
The custom function works only on a character field. When creating a virtual field make sure that there is the same number of characters as the original field.
- Read more about showFormat
- Log in or register to post comments
How to add seconds to a time field
Forums
I had a member that wanted a one line solution on how to add seconds to a time field that was in character format. This is what I came up with. I also made it into a custom function if anyone else needs this functionality.
- Read more about How to add seconds to a time field
- Log in or register to post comments
Videos on Custom Functions
Forums
I just created two videos on creating custom functions. You can find them here.
- Read more about Videos on Custom Functions
- Log in or register to post comments
FIRSTDIGIT - extract the first digit from a numeric field
Forums
This custom function comes out of a scripting course I give in which we create a script that performs benford 1st digit analysis at the client or vendor level instead of over the entire database. One of the steps is to extract the first digit of the numeric field that we are looking at. So usually we create the forumal using the equation editor but I thought it would be fun to create a custom function to do the same thing. So here it is, it should be easy to modify for more than 1 digit. It will extract the first digit, it ignores the negative sign and if the number
SoundEx
Forums
IDEA already has a function that performs the soundex function which is the @Soundex function that is defined as "Determine whether text is similar in sound.
- Read more about SoundEx
- Log in or register to post comments