Formula to Extract Numbers From Narration

Discussion in 'Tally Developer' started by psr, Sep 22, 2020.

    
  1. psr

    psr Member


    Dear Members,

    I want to extract Only Numbers after the word Chq No. from Narration part. Can anyone guide me with the correct formula?

    Thank you
     


  2. kirandham

    kirandham New Member


    Hi for that you need to write a function here i same sending sample code for your refernece

    [#Part: EXPINV DelNote]
    Add:Option:del:mad:@ispurcorder
    [!Part:del]
    Delete:Invisible
    Local : Field : EXPINV SubTitle :delete: Info : If @@IsSales AND ##SADespatchDet Then $$LocaleString:"Delivery Note" Else ""
    Local : Field : EXPINV SubTitle : add:Info :"Voucher No.";If @@IsSales AND ##SADespatchDet Then $$LocaleString:"Delivery Note" Else ""
    Delete:Bottom Line:EXPINV DelNote
    Local : Field : EXPINV SubTitle :delete: Inactive: NOT @@IsSales OR NOT @@DespatchDet

    Add:Bottom Line:test
    [Line: test]
    Field : Name Field
    Local : Field : Name Field : Set as : $$function;if NOT $$IsSysName:$BasicShipDeliveryNote then $$FullList:InvoiceDelNotes:$BasicShipDeliveryNote else ""
    Local : Field : Name Field : Width : 25% Page
    ; Local : Field : Name Field : Inactive: NOT @@IsSales OR NOT @@DespatchDet
    Local : Field : Name Field : Cells : ($$Quotient:mad:@ExcelCellColumn:4)

    [Function:function]
    Variable:var:String
    Variable:tar:String
    Variable:ff:String
    Variable:test:String
    sdfd:Set:var:$$String:$vouchernumber
    dsf:Set:tar:$(Vouchertype,$Vouchertypename).PREFIXLIST.Name
    dcv:Set:ff:$$StringLength:##tar
    fdfgf:Set:test:$$StringPart:##var:##ff:1
    dsfcv:Return:##test

    ;
    ; [Line:test1]
    ; Field:test1
    ; [Field:test1]
    ; Use:Namefield
    ; Set as:$$LocaleString:"Voucher No."
    ; Style:small
    [#Line: EXPINV Number]
    Add:Option:rr:mad:@ispurcorder
    [!Line:rr]
    Local : Field : Name Field :delete: Set as : $VoucherNumber
    Local : Field : Name Field :add: Set as : $(Vouchertype,$Vouchertypename).PREFIXLIST.Name




    [#Part: EXPINV Number]

    Lines : EXPINV SubTitle
    BottomLines : EXPINV Number
    Local : Field : EXPINV SubTitle : delete:Set as : @@INVNumTitle




    above is sample code for your refence refer and achive your requriment ..
    All the best
     
    psr likes this.


  3. Rubazi

    Rubazi New Member


    Use this the below:

    $$ExtractNumbers:"Ch. No. 123"
     


Share This Page