Forum Discussion

FML's avatar
FML
Regular Visitor
1 year ago
Solved

Startofmonth() in Virtual Table

buen día, no puedo utilizar la función Startofmonth() con una columna de una tabla virtual, generada mediante crossjoin. Me pueden ayudar por favor ? gracias

 

 

  • Trying using this instead

     

    Eomonth( [value], -1) + 1

10 Replies

  • Deku's avatar
    Deku
    Super User

    Remove the calculate to avoid context transition

    • FML's avatar
      FML
      Regular Visitor

      OK, THANKS, 

      last question,

       I need to retrive a value from a table "f_Forecast Litros" .
      I´m trying to use lookup value with the column @InicioMe (a column generated in my virtual table, but I can´t select it (similar to Value) I think its the same issue, the filter context but I don´t know how to solve this, can you help me please ?


       

      • Deku's avatar
        Deku
        Super User

        If you create a field with addcolumns, you cannot access it from another column in the same addcolumn expression. You would be able to access it if you were to iterate the virtual table with sumx or addcolumn. 

         

        What you can do is, instead of defining @InicioMe as a field, you can define it as a variable within @forecast mes

         

        Addcolumns(

        ... ,

        "Forecast mes"

        Var @InicioMe = ....

        Return

        ....

        )

  • FML's avatar
    FML
    Regular Visitor

    thanks for for answer, but it doesn't work !

     

    • Deku's avatar
      Deku
      Super User

      Trying using this instead

       

      Eomonth( [value], -1) + 1

      • FML's avatar
        FML
        Regular Visitor

        Excellent Deku !!!! it works !!!

        Can you explain me how it works and why endofmonth doesn´t ?