Birt row.__rownum not working when sent to function - birt

Sent row.__rownum to function as index but it didn't work.
It always takes the value for first row.
Is it not correct to send it to a function?

It is
row.__rownum
with two leading underscores.

Related

how to make Google sheets REGEXREPLACE return empty string if it fails?

I'm using the REGEXREPLACE function in google sheets to extract some text contained in skus. If it doesn't find a text, it seems to return the entire original string. Is it possible to make it return an empty string instead? Having problems with this because it doesn't actually error out, so using iserror doesn't seem to work.
Example: my sku SHOULD contain 5 separate groups delimited by the underscore character '_'. in this example it is missing the last group, so it returns the entire original string.
LDSS0107_SS-WH_5
=REGEXREPLACE($A3,"[^_]+_[^_]+_[^_]+_[^_]+_(.*)","$1")
Fails to find the fifth capture group, that is correct... but I need it to give me an empty string when it fails... presently gives me the whole original string. Any ideas??
Perhaps the solution would be to add the missing groups:
=REGEXREPLACE($A1&REPT("_ ",4-(LEN($A1)-LEN(SUBSTITUTE($A1,"_","")))),"[^_]+_[^_]+_[^_]+_[^_]+_(.*)","$1")
This returns space as result for missing group. If you don't want to, use TRIM function.

Custom Data Validation with possible Number or Word

Ok so here is what I have so far. The following works properly preventing non numbers and more than 2 occurrences of each number.
=AND(ISNUMBER(K2),COUNTIF(K$2:K$20,K2)<3)
Next I need to add in the option for the field to be 'BYE'.
So each of the cells can contain a number that cannot occur more than twice or it can contain 'BYE'
Anyone have any advice on how to achieve this? Is there a way to say it can be like this or like that?
You could use OR.
=OR(K2="BYE",AND(ISNUMBER(K2),COUNTIF(K$2:K$20,K2)<3))

How to Select Only Alphanumeric characters from a string in Datastage?

I am facing a problem with my data, in my data other than alphanumeric characters are there in a column field, where for EX in Name column: Ravicᅩhandr¬an (¬ᅩ○`) like these many characters are there. I need a result like Ravichandran. How can I achieve this? Is there any way to remove in transformer stage.
I tried Convert function in Transformer stage, but problem in using Convert, I am not sure about these unknown characters, I have shown above is just example.
My Requirement is, other than alphanumeric must be removed. And the Balance string should be the same.
How can I get this done?
The following Convert function can be used in Transformer stage to remove any kind of unknown/special characters from the column.
**Convert(Convert('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ','', Column_Name1),'',Column_Name1)
Ex : Convert(Convert('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 ','', to_txm.SourceCode),'',to_txm.SourceCode)**

XPath & Replace Exact Match

can anyone help me with this?
I'm trying to change fields that have a "0" to Nothing.
I have this:
[str_replace("0",",{price[1]/sale[1]})]
but I think this will replace all fields that "contain" a 0 so for example if it had 301 then it would become 31. What I want is to only replace fields that only contain a single 0 to nothing.
How can I do this? (the code needs to be on a single line as it's run on a form field)
A simple way to do this may be as follows (not tested!):
[{string(price[1][number(sale[1]) != 0]/sale[1])}]
This expression includes an additional condition to only find the number if it is not 0 in the first place. If found it returns the number, otherwise it will return an empty string since the function string of an empty node set should yield exactly this.

How to use jqgrid jqid method?

I'm still struggling with getting jqgrid's viewGridRow function to handle grids that have column names that include spaces. I came up with a hack to replace spaces with underscores but was told that that I should be using jqID instead. Specifically,
If you want modify the code you should better use $.jgrid.jqID instead of replacement of blanks to undescores. The function $.jgrid.jqID are used in the most places of jqGrid code, but still not everywhere. The problem it very easy. It one have meta-characters as the part of id and one want to use the id as a part of the jQuery selector one have to escape the characters. The method $.jgrid.jqID do exactly the job.
Upon looking at the source code inside grid.base.js, I see that the function is defined as
$.extend($.jgrid,{
jqID : function(sid){
return String(sid).replace(/[!"#$%&'()*+,.\/:;<=>?#\[\\\]\^`{|}~]/g,"\\$&");
}
});
which leads me to believe that it should be perhaps used in the beforeProcessing() function to modify the cell IDs? Regardless, I don't see that the regex, as it currently exists, specifically handles spaces.
Oleg, if you're out there, help!!! :)
D'oh!! As soon as I hit submit, I realized that Oleg meant to modify the jqID function to add spaces to the regex string. That seems to do the trick.

Resources