Generate Random Number (Pls Solve)

Discussion in 'Tally Developer' started by pradeep kumar dewangan, Feb 18, 2022.

    

  1. Random Number.png
     

    Attached Files:




  2. any body developers, solve please
     


  3. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Your TDL code is fine.. there is no 2nd line as there are no parameters given to it...

    Since your code does not have any collection of data like ledgers or vouchers etc, it will assume that 1st line is the last line.

    You introduce a END Date to continue until the end date is reached OR introduce a condition to stop when Sr# 100 is reached.
     



  4. dear sir,
    I need round(randbetween(" & amt1 & "," & amt2 & ") excel formula in TALLY currently I have 75 : Set : VoucherAmt : if ##Counter = 1 then ##InputAmt else $$RandomNumber:1:($ $Number:##InputAmt/2) is doing USE but not much use
     


  5. Jenny

    Jenny Active Member


    if u want to between value create automatic random number and How many times do you need a random number create a function for that
     


  6. Jenny

    Jenny Active Member


    ;;;;See that for random date....it will help you

    Code:
    [#MENU  : GatewayofTally]                                   
      ADD     :   KEY ITEM   : BEFORE   : @@LocQuit  :  MyRandomDate  : G :  Display : RandomDate  
                            
    [REPORT :  RandomDate ]                                   
        TITLE         : "Function Testing "                                    
        FORM        :   RandomDate                                    
                                           
    [FORM  :  RandomDate ]                                   
        PART  :  RandomDate
                                       
    [PART :  RandomDate ]                                    
        LINE   :  RandomDate 
           
    [LINE :  RandomDate  ]                                   
        FIELD  : Name Field,  RandomDate                                 
        LOCAL : Field: Name Field: Info:  "Random Date"
    
    [FIELD  :  RandomDate  ]                                   
        USE            :  Short Date Field                                   
        SET AS      :  $$GetRandomDate
        ALIGN       : Center
        WIDTH     : 15    
        MAX          : 25                   
    
    [FUNCTION  : GetRandomDate]                                   
       
        Variable         :  BegDt       : Date                                    
           Variable         :  EndDt      : Date                                    
           Variable         :  WDay1     : String                                   
           Variable         :  WDay2     : String
        Variable         :  cnt            : Number
        Variable           :  MyDay     : Number
        List Variable  :  WeekList : Date   
    
        RETURN      :  Date                                   
    
        000 :  LOG    : "Entered Funcation"
            005 :  Set: BegDt : ##SVFromDate
        006 : Set: EndDt : ##SVToDate
        010  :  SET    : WDay1    : "Monday"        
        020 :  SET    : WDay2    : "Tuesday"            
         030 :  FOR RANGE : IteratorVar :Date :##BegDt : ##EndDt : 1                                           
                      040 :     IF : ($$DayofWeek:##IteratorVar) = ##WDay1 or ($$DayofWeek:##IteratorVar) = ##WDay2
        050 :        INCREMENT  : Cnt                                           
        060 :            List Add          : WeekList : ##cnt : ##IteratorVar                                           
                 ;;; 070 :            LOG : $$ListValue:WeekList:##cnt
        080 :      END IF                                               
        090 : ENDFOR                                           
        100 :  Set: MyDay: ($$RandomNumber:1:##Cnt)
        110  : LOG : "My Random Date is: "
                      120 : LOG : $$ListValue:WeekList:##MyDay
        130 : Return : ($$ListValue:WeekList:##MyDay)
     


  7. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    is doing USE but not much use -- Kindly explain clearly -- do not understand this cryptic one. :confused:
     



  8. 12000 =ROUND((E12/12)-(ROUND(+E12/12,)*25%),) =+E12/12 =RANDBETWEEN(F12,G12)
    12000 850 1000 957
    12000 850 1000 955
    12000 850 1000 870


    I want
    12000 =ROUND((E12/12)-(ROUND(+E12/12,)*25%),) =+E12/12 =RANDBETWEEN(F12,G12)
     



  9. Dear Amit Kamdar sir ji,

    Please above code, update & solve
     


  10. Amit Kamdar

    Amit Kamdar Administrator Staff Member


    Do not understand what you need??? You min and max range and then start and end date .... so what exactly u need ??
    Make a excel file with required data so we can understand.
     


Share This Page