4 Replies Latest reply: Mar 6, 2014 8:45 AM by Michael Steedle RSS

    Date comparison not working

      I have a variable

      vCurrPeriodEnd , vCurrPeriodStart date variable


      VPrevPeriodEnd =if(_CompareType='Year over Year',




      and I am using it like this


      I am putting this in a Set analysis and its not working.

        • Re: Date comparison not working
          Manish Kachhia



          Period = {'>=$(Daystart('vPrevPeriodStart')) <= $(=Daystart('vPrevPeriodEnd'))'}

          • Re: Date comparison not working
            jagan mohan rao appala



            The formats are same for Daystart(vPrevPeriodStart) and Period dimension, if they are not same then convert by using


            Date(Date#(Period, "DateFormat")) or Timestamp(TimeStamp#(Period, "DateFormat"))




            • Re: Date comparison not working

              hi anil,

              please check your both dates in Text box, look whether both they  are in Same format

              • Re: Date comparison not working
                Michael Steedle

                There is no such things as a date variable in QlikView, as variables do not have data types. That may be part of the problem, as date comparisons in Set Analysis require you to have identical formatting between the field and the comparison value (your variable), which may not match in your application.


                I would suggest plugging that formula into the expression of a straight table. Do not give the expression a label, and the expression label will show your formula after dollar sign expansion/text replacement, helping you see how QlikView is evaluating your logic.


                There's not enough information about your data, variables, or their values and formatting to definitively answer your question.