2 Replies Latest reply: Jul 19, 2011 11:21 AM by Hamish Donald RSS


      Hello everyone,


      I have a problem with a table using calculated dimensions with valuelist.

      What I want to display is a certain value (income) over each month for a selected year and the corresponding prior year.


      My table has 1 dimension:



      Then for each month I have a column in which I want to calculate the income for the present and for the past year (the 2 lines of the dimension). I tried the following:



      Unfortunatelly this does not work. With the above shown formula I always get the income value for January of the present year in both lines (present and past year).

      Could anyone help me out with this and tell me what am I doing wrong?


      Thanks a lot!


        • valuelist

          Hey again,


          I have been searching around some more and I have found a post where they described the if-statement for the use of valuelists.


          I have now changed my expression to the following (my dimension is still the same):




          Unfortunatelly this doesn't work either. Now I get no values at all in my fields.

          If I try to use fixed values in the valuelist (e.g. valuelist(2009,2008)) then it does work alright. Is it not possible to keep the valuelist flexible with variables?


          Does anyone have any ideas with this? Thanks a lot!


            • Re: valuelist
              Hamish Donald



              It could be that you're missing some '=' symbols before the odd 'only'


              I copied your syntax on a test qvw and it worked fine







              so maybe the bits I've added an underlined = symbol below are missing an '=' just before the 'Only(Jahr)'


              if(valuelist($(=Only(Jahr)),$(=Only(Jahr)-1))=$( = Only(Jahr)),count({$<Jahr={$(=Only(Jahr))},Monat={Jan}>}UmsatzBestZeile),

              if(valuelist($(=Only(Jahr)),$(=Only(Jahr)-1))=$( =   Only(Jahr)-1),count({$<Jahr={$(=Only(Jahr)-1)},Monat={Jan}>}UmsatzBestZeile),''))


              It might be easier to create variables like vY and vLastY so you just have to do the dollar replacement in both dimension and expression e.g.