Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

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:

Capture.PNG

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:

Capture.PNG

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

1 Solution

Accepted Solutions
sunny_talwar

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

View solution in original post

2 Replies
sunny_talwar

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

OmarBenSalem
Author

Thank you Sunny for your time