Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have my filtre : TypeCA='Prestations saisies', Annee=2020 and Month= Mai
I would like change the Measure for every value of TYPECA and to show the timeline max(DATE ) -11 Months --> to Max(DateSelected)
For example : for TypeCA='Prestations saisies' I want you use this expression:
(Sum({1<AnnulationDejaPayee={0}, Date={">=$(vDate_11)<=$(vMaxDate)"}, Annee= ,TypeCA=, Mois=>} Prest_Montant ) / Count(Distinct {1< Date={">=$(vDate_11)<=$(vMaxDate)"}, Annee= ,TypeCA=,Mois=>} [IDAgentSoin]) )
.. and without using the IF Statement , I have this perfect LINE : (cool)
but..... with the same filters , same SET ANALYSIS , if I use the IF THEN ELSE before the set analysis :
if(TypeCA='Prestations saisies',
(Sum({1<AnnulationDejaPayee={0}, Date={">=$(vDate_11)<=$(vMaxDate)"}, Annee= ,TypeCA=, Mois=>} Prest_Montant ) / Count(Distinct {1< Date={">=$(vDate_11)<=$(vMaxDate)"}, Annee= ,TypeCA=,Mois=>} [IDAgentSoin]) )
)
I have this result: only the value for the Mois=Mai is showed
Why ?? How the IF THEN ELSE has an impact on my SET ANALYSIS??
@steeramp try with getfieldselections
if(getfieldselections(TypeCA)='Prestations saisies' , YourExpression, OtherExpression)
@steeramp try with getfieldselections
if(getfieldselections(TypeCA)='Prestations saisies' , YourExpression, OtherExpression)
You are the best one !! Can you explain the differences?
@steeramp If condition tries to evaluate the expression row by row which could override the set expressions and generates inaccurate results. Whereas if you use getfieldselections it just looks at the selection made and evaluates the expression as whole considering selection you made.
Great !