Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
zied_ahmed1
Specialist
Specialist

condition depend on a month

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

4 Replies
OmarBenSalem

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))

zied_ahmed1
Specialist
Specialist
Author

Values of Maroc in the dynamique table still change when i select a month (filter Mois)

OmarBenSalem

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?

sunny_talwar

Is MarocDoublons created in script or is this a variable?