2 Replies Latest reply: Mar 22, 2017 5:41 AM by omar bensalem

# If Condition in a table

Hi everyone, ( stalwar1),

Here is my table:

Dimension: Pays, column : month of date

measure:

if pays = maroc  then :

Count({<[Year of date]={\$(=max([Year of date]))}, [Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C},

Dossier = {"=Count({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>}Aggr(COUNT({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>} Code_Carrier&Plaque),Date_Embarquement,Plaque))=1"}>} Dossier)

,

if pays <> maroc then:

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

here is how I wrote it :

if(Pays='Maroc',

Count({<[Year of date]={\$(=max([Year of date]))}, [Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C},

Dossier = {"=Count({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>}Aggr(COUNT({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>} Code_Carrier&Plaque),Date_Embarquement,Plaque))=1"}>} Dossier)

,

if(Pays<>'Maroc',

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

))

result:

What I want is, even so I select a month, my table must not change ; but with the way it is, there is some changes in the line Maroc when I select a month:

See: I select Fev; only the value for Maroc on Fev does not change, Janv and Mars does change in Maroc:

Now, if my expression was only treating the Maroc part:

Count({<[Year of date]={\$(=max([Year of date]))}, [Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C},

Dossier = {"=Count({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>}Aggr(COUNT({<[Month of date]=, Code_Ligne={'MAR'}, Groupe_Complet_Vide = {G,C}>} Code_Carrier&Plaque),Date_Embarquement,Plaque))=1"}>} Dossier)

, the table won't be afffected with a selection of a Month of date

But when there is an If condition, Maroc is always changing when I select a month..

Any idea on how should I alter my measure?

tHANKS

• ###### Re: If Condition in a table

omarbensalem if this is resolve then please close this thread by marking assumed answer (and all the remain threads which are still open on this same topic)

I guess the issue was to ignore selection in the if statement part of the equation

If(Only({<[month of date]>}Pays) = 'Maroc',

Thanks,

Sunny

• ###### Re: If Condition in a table

Thank you Sunny for your time