Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a plot chart with 2 dimension Annee & Mois
I want to calculate for each month an index based on january (Mois=01)
so my expression is:
Sum ([CA HT en euros]) / Sum ( {<Mois=01>} [CA HT en euros])
But no chart is displayed.
In my input table the field Mois take the value 01, 02 , ...., 12
Thanks in advance for your help
Jean-Jacques
I'm guessing those months are strings as they have a leading zero. Try:
Sum ([CA HT en euros]) / Sum ( {<Mois='01'>} [CA HT en euros])
This expression is respecting the dimension for the record it is in. I'd guess you want something like:
Sum ([CA HT en euros]) / Sum ( {<Mois='01'>} TOTAL [CA HT en euros])
That will get you the sum for whatever dimension you have divided by the total for January, ignoring the dimension.
Thanks NMiller for your answer but it didn't work. You guessed well about the calculation.
As i have also the year in the file, i created a new field as :
Monthname( Makedate(Annee , Mois)) as MonthName ,
How can write the expression using MonthName = January ? I'm sure you have an idea and allow to bypass the string for Month.
JJ
Hello Jean-Jacques,
If you have set a MonthNames variable in your script (it is by default), you may use for your set analysis something like
where the subfield function will return your default month name...Sum ( {<Mois = {$(=Subfield(MonthNames, ';', Num(Mois)))} >} [CA HT en euros])
Maybe something like:
Sum ([CA HT en euros]) / Sum ( {<MonthName='Jan'>} TOTAL [CA HT en euros])
You'll need to verify the format of your MonthName field and format the set modifier accordingly.