I was trying to find the position of a character from a string but didn't find any function for the same. Like, in SQL we have charIndex and in MySql there is Position function
Hi @Rachi Manwal ,
Please clarify what app/macro are you using for the case?
If we are talking about our Table Filter and Charts for Confluence app and its Table Transformer macro, you may try the following query:
SELECT *,
T1.'String to find'->indexOf("new") AS 'Position'
FROM T1
Thank you @Katerina Kovriga _Stiltsoft_ , I am using the Table Transformer macro. Could you let me know any resource where I could find these functions. I am a bit confused, is this not totally sql?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, you are right - it's a bit of JavaScript provided by our developers.
The JavaScript methods in general are documented here, but if you have any specific case that is not very common and is not documented, you may raise a support request (the portal is confidential), attach a screenshot of your original table with a visible header row and describe what you need to achieve - our engineers will provide you with a corresponding query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Rachi Manwal ,
Another hint from our developers - in the AlaSQL query on which our Table Transformer macro is based, it's INSTR function:
SELECT *,
INSTR(T1.'String to find',"new") AS 'Position'
FROM T1
The output for my example table will be 11 and 16 respectively. Here you may correct the output by +/-1: the indexOf function begins to count from 0 (so we got 10 and 15), the INSTR function - from 1. So here comes the difference.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.