3 Replies Latest reply: May 9, 2012 7:20 AM by jonnadegerman RSS

    Last Month Label & Error Message

    Bill Ringer Salalima



      How can I put an error message like "Please select Year and Month' to viiew this report"


      And, how can I put the Label, "last month"


      say for example, this month is Feb 2012, then last month is Jan 2012...


      Please help me, im using Qlikview 11. Thanks.


      Best Regards,


        • Re: Last Month Label & Error Message



          For an error message you can use an if statement like:


          if(GetSelectedCount([Year Month]) >= 1, expression, 'Please select Year and Month to View this report")


          And for labels you can use in the window title =max(Month) & ‘ ‘ & max(Year)

          And if you want previous month or previous year you add -1 =(max(Month)-1) & ‘ ‘ & (max(Year)-1)

          • Last Month Label & Error Message



            Can you send the .qvw? Or an example of what your data looks like? The set analysis looks correct.

            When I have encountered that problem before the problem have been that my data have had more dates than I had data for. Example:


            Year     Month     Sales

            2012     1            20

            2012     2            30

            2012     3            40

            2012     4       

            2012     5


            So the max date is May 2012 in the data, but since there's no sales for that month, it won't display any data.


            What does the lable say for the max(month)?