0 Replies Latest reply: Jun 11, 2013 3:09 AM by Hari V RSS

    If Statement in Qlikview

      Hello,

       

      Can you please try below statement.

       

      Avg(

                Aggr(

                          If(

                                    // First Month

                                    Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales] ) <=0,

                                              (

                                                        Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv) // Remaining Inventory

                                                        /

                                                        Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales])

                                              )

                                              *

                                              Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Days]) * 7 , // First Months Days

                          If(

                                              // Second Month

                                              Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales] - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Sales] ) <=0 ,

                                                        (

                                                                  (Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales])) // Remaining Inventory

                                                                  /

                                                                  Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Sales])

                                                        )

                                                        *

                                                        Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Days]) * 7 // Second Months Days

                                                        +

                                                        Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Days]) * 7,  // First Months Days

                                              If(

                                                        // Third Month

                                                        Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales] - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Sales] - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 3 Sales] ) <=0 ,

                                                                  (

                                                                            (Sum ($(eCycleGroupLevel_MasterCycle_Field)_Sum_End_Inv - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Sales] - [$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Sales])) // Remaining Inventory

                                                                            /

                                                                            Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 3 Sales])

                                                                  )

                                                                  *

                                                                  Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 3 Days]) * 7 // Third Months Days

                                                                  +

                                                                  Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 2 Days]) * 7 // Second Months Days

                                                                  +

                                                                  Sum ([$(eCycleGroupLevel_MasterCycle_Field)_Next Month 1 Days]) * 7 // First Months Days

                                              )

                          )

                          )

                , $(eCycleGroupLevel_MasterCycle2), ACCT_MO_NM_ABBR // Aggregation

                )

      )

       

      The condition is satisfied but i can't able to get the data in the chart. Can you please suggest any ideas.?

       

      Regards,

      Hari

       

      Message was edited by: mvhariharan