7 Replies Latest reply: Oct 14, 2012 4:27 PM by 953582 RSS

    @Xrange function problem

      Dear all,

      I've tried using the @xrange function, it's validating but it doesn't take into consideration the months in the next year: I need to get the sum of an element across different scenarios and years as mentioned below:

      Acc_3 =((Acc_1->"AUG"*Acc_2->"AUG")+(Acc_1->"SEP"*Acc_2->"SEP")+(Acc_1->"OCT"*Acc_2->"OCT")+(Acc_1->"NOV"*Acc_2->"NOV")+(Acc_1->"DEC"*Acc_2->"DEC")+(Acc_1->"JAN"->&V_BUDGET_YEAR->"BUdget"*Acc_2->"JAN"->&V_BUDGET_YEAR->"BUdget"))/@Sumrange(Acc_1,@Xrange("AUG"->&V_CURRENT_YEAR->"Forecast","Dec"->&V_BUDGET_YEAR->"Budget"));

      I tried cutting it into pieces until I found out that it doesn't take into consideration the data in &V_BUDGET_YEAR->Budget

      Is there anything wrong with that logic ?
        • 1. Re: @Xrange function problem
          Do you have forecast then budget in your your outline? Months will go in order of the outline, which makes sense and is intuitive. I believe the other dimensions work the same way, it would take what is between Forecast and Budget. If Budget is not after Forecast, I am not sure it would understand what you are asking for.

          Kyle Goodfriend
          Please make sure to assign helpful/answered to responses if applicable - it rewards those who help and benefits the user community.
          • 2. Re: @Xrange function problem
            Yes, "Forecast" comes before "Budget" in my outline.. But I'm not sure I'm getting you correctly.. so, what's the issue? why isn't it working?

            I'm asking for data from August in forecast in FY12 till December in Budget in FY13... how can I reach it by this xrange function? as I assumed that the logic I used will make it work.

            Thanks Kyle.
            • 3. Re: @Xrange function problem
              I know I am not answering the question about xrange, but you could change the xrange function to the following and it should work.


              As far as Xrange,

              Are you saying that if you did something like @XRANGE(ACCT, "Jan"->&V_BUDGET_YEAR->"Budget","Dec"->&V_BUDGET_YEAR->"Budget"), you would get nothing? I know this isn't your end goal, but if this doesn't provide you the data you expect, I would look at whether the variables have the right year and make sure data exists (I know you probably already have). If you change the variable value, make sure you restart the app.

              Edited by: Kyle Goodfriend on Oct 11, 2012 10:31 AM
              • 4. Re: @Xrange function problem
                I've tried the @list function but it gives me error "Invalid argument in function".. is there anything missing in it? I didn't try before this long range in @list.,

                Yes, in xrange, it gives a wrong calculation, which discards the months in the next year.
                • 5. Re: @Xrange function problem
                  You can't use cross dims in @LIST, my bad.

                  @LIST should accept any number of arguments and is used to add members together for another function that takes a list of members.

                  I think your Xrange is fine, it is the reference for your budget year.

                  If you just have @Sumrange(Acc_1,@Xrange("Jan"->&V_BUDGET_YEAR->"Budget","Dec"->&V_BUDGET_YEAR->"Budget")), what do you get? If you get 0, I would look at the variable. Update it in EAS (make sure you hit set so it saves), restart the app, and try it again.

                  Maybe I am missing something....
                  • 6. Re: @Xrange function problem
                    Hi Kyle,

                    The variable isn't new...it's referenced everywhere in the application..

                    I'm not trying the syntax you wrote for the xrange as it's within the same year and scenario...my xrange was trying to get from august this year, in forecast scenario...till december next year in budget scenario......which didn't return any number..nothing..

                    Is there any bug with the xrange function or any workaround to acheive the desired result ?
                    • 7. Re: @Xrange function problem
                      I am suggesting you try it JUST to see if you get any data. If you try this, and don't get any data, I would look to something outside the XRANGE function, like the data in the intersection you are trying to retrieve, or the variable.