Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I have field SEC_ACCT_NO which contains more than 15 digits and less than 15 digits. We have to show last 15 digits for that am using the ‘RIGHT’ function to get the 15 digits only.But how we can put Prefix’Zeros’ which are having less than 15 gitits.
Is their any function available in QV like Lpad,rpad in oracle.
The same has been attached.
Thanks,
Dhanu
Try:
If(Len(SEC_ACCT_NO)>0, Repeat('0',15-Len(SEC_ACCT_NO))&Right(SEC_ACCT_NO,15) ,SEC_ACCT_NO) AS SEC_ACCT_NO_DERIVED
Hi Dhanu,
As I understood you need a result like everything in the same format without zeroes.
If so, you can use simple IF in the load script like
IF(len(SEC_ACCT_NO)>15,RIGHT(SEC_ACCT_NO,15),SEC_ACCT_NO) AS YourField
Try:
Repeat('0',15-Len(SEC_ACCT_NO))&Right(SEC_ACCT_NO,15)
So, probably I caught your idea try this in your load script
PFA an example. I've done it for a dimension.
IF(len(SEC_ACCT_NO)>15,RIGHT(SEC_ACCT_NO,15),REPEAT('0',15-LEN(SEC_ACCT_NO))&SEC_ACCT_NO) AS YourField
Hi may be like this.
Regards
ASHFAQ
Like this..
Right(Repeat('0',15) & SEC_ACCT_NO,15)
Hi,
I would use:
Right(Repeat('0',15) & Text(SEC_ACCT_NO) ,15)
- Ralf
Thanks Tresseco and all ...Its working.But am getting the 15 digits as zero's even though the SEC_ACCT_NO having '-'.i have to show if its as itself like '-'.
Thanks,
Dhanu
Could you post a sample that demonstrates the issue?
Thats True.Any how am adding the sample app.