6 Replies Latest reply: Apr 15, 2016 5:05 PM by Sunny Talwar RSS

    need to Condition verify

    Subba Reddy

      Hi Folks,

       

      i am trying to display latest 12 weeks data in the below expr, can any one correct it.

       

      If( GetSelectedCount(WeekFlag)=0 and GetSelectedCount(QuarterFlag)=0,

      Count({$<WeekFlag={">=$(=(Max(WeekFlag))-84)}<$(=(Max(WeekFlag)))"}>}WeekFlag),

      If(GetSelectedCount(QuarterFlag)>0,GetFieldSelections(QuarterFlag),GetFieldSelections(WeekFlag))

      )

       

      Now i go all the weeks data. i wat to show only last 12 weeks.

       

      Regards,

      Sub2u444.

        • Re: need to Condition verify
          Sunny Talwar

          How does the WeekFlag field look like? Is it a datefield or a flag created on datefield?

            • Re: need to Condition verify
              Sunny Talwar

              Try this:

               

              If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

              Count({$<WeekFlag={">=$(=Max(WeekFlag)-84))<$(=Max(WeekFlag))"}>}WeekFlag),

              If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))


              You mistakenly used a curly brackets in place of parenthesis

              • Re: need to Condition verify
                Subba Reddy

                Its Date Only.

                  • Re: need to Condition verify
                    Sunny Talwar

                    If is it number formatted:

                     

                    If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

                    Count({$<WeekFlag={">=$(=Max(WeekFlag)-84))<$(=Max(WeekFlag))"}>}WeekFlag),

                    If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))

                     

                    If date formatted:

                     

                    If(GetSelectedCount(WeekFlag) = 0 and GetSelectedCount(QuarterFlag) = 0,

                    Count({$<WeekFlag={">=$(=Date(Max(WeekFlag)-84), 'DateFieldFormatHere')))<$(=Date(Max(WeekFlag), 'DateFieldFormatHere'))"}>}WeekFlag),

                    If(GetSelectedCount(QuarterFlag) > 0, GetFieldSelections(QuarterFlag), GetFieldSelections(WeekFlag)))

                      • Re: need to Condition verify
                        Subba Reddy

                        Hi Sunny,

                         

                        Thanks for the reply.

                         

                        the above exp i am using at limitation, need to show only latest 12 weeks data.

                         

                        Count({$<WeekFlag={">=$(=(Max(WeekFlag))-84)}<$(=(Max(WeekFlag)))"}>}WeekFlag), -- here can i use weekflag again, i am little bit confusion..is it show last 12 weeks

                         

                        Regards,

                        Subba

                          • Re: need to Condition verify
                            Sunny Talwar

                            You are using at limitation? What do you when you say latest 12 weeks data and last 12 weeks data? Do you mean different things here? I am confused of what you are looking for.

                             

                            Like before fix the the curly bracket

                             

                            Count({$<WeekFlag={">=$(=(Max(WeekFlag)-84)))<$(=(Max(WeekFlag)))"}>}WeekFlag)