4 Replies Latest reply: Mar 19, 2017 9:24 AM by Sunny Talwar RSS

    condition depend on a month

    Zied Ahmed

      Hello,

      I have a problem , i have condition for MAR

      this is the values of the MAR that i need to have :

       

      1.png

      the problem is when i select the filter "Mois" (Month) the values change, i added the field Month of date= in the expression and the values of "Maroc" changes:

      2.png

      so this is the expression and thanks to help me

        • Re: condition depend on a month
          omar bensalem

          Change your condition as follow:

           

          if (Code_Ligne='MAR',

          if (

          Mod(count( distinct {<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={1}>} Plaque),2)=1,

          (

          Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Groupe_Complet_Vide={C,G},Timeframe=,[Month of date]=,Flag_Doublon={1}>}Dossier)

          /

          count(  {<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Groupe_Complet_Vide={C,G},Timeframe=,[Month of date]=,Flag_Doublon={1}>} Plaque)

          )

          +

          Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={0}>}Dossier),

          (

          Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={1}>}Dossier)

          /

          count( distinct {<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={1}>} Plaque)

          )

          +

          Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={0}>}Dossier)),

          Count({<[Year of date]={$(=max([Year of date]))},Timeframe=, [Month of date]=,Groupe_Complet_Vide={C,G}>}Dossier))

          • Re: condition depend on a month
            omar bensalem

            Hi stalwar1,

             

            I think that we should have something like this:

             

            we have these 3 expressions that result into a value :

            (

            Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Groupe_Complet_Vide={C,G},Timeframe=,[Month of date]=,Flag_Doublon={1}>}Dossier)

            /

            count(  {<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Groupe_Complet_Vide={C,G},Timeframe=,[Month of date]=,Flag_Doublon={1}>} Plaque)

            )

            +

            Count({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Timeframe=,Groupe_Complet_Vide={C,G},[Month of date]=,Flag_Doublon={0}>}Dossier)

             

            Suppose these 3 combined = a new measure, let's call it MarocDoublons

            The solution, I guess would be :

             

            sum({<[Year of date]={$(=max([Year of date]))},Code_Ligne={'MAR'},Groupe_Complet_Vide={C,G},Timeframe=,[Month of date]=>}MarocDoublons)

             

            But when I tried to do this, I got null values, as if the expression was wrong

            Isn't it possible to proceed as so?