Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi every one , Good Morning !
Today I need help in finding the field name of the expression. I created a
1) Bar Chart with
2) Dimension : a) Region
b) =if(Month1=2,'Feb',If(Month1=3,'Mar',if(Month1=4,'Apr',if(Month1=5,'May','Jun')))) [ Label = Month ]
both the dimension is grouped together and named as Group1.
3) Expression : Sum(Sales)
To get the result : I used =if(GetCurrentField([Group1])='Region','A',if(GetCurrentField([Group1])='Month1','B','C'))
but i did the result B .
HI
use =only(GetCurrentField(Group1)) to show level name
and for calculated Dimension use variable with name 'Month'
Hi Samane,
If I used this formula =only(GetCurrentField(Group1)) then when i go to month1 section it will give me the expression that i used but I need label not expression for month1 field.
May be like this:
=GetCurrentSelections('|','=')
=GetFieldSelections(Suppliers.CompanyName)& ‘ – Freight’
Try this
=If(GetCurrentField([Group1]) = 'Region','A',
If(GetCurrentField([Group1]) = '=if(Month1 = 2,''Feb'',If(Month1=3,''Mar'',if(Month1=4,''Apr'',if(Month1=5,''May'',''Jun''))))','B','C'))
The quotes in red are two single quotes (NOT a single doube quote)
I use usually in such cases a dimension like:
= Expression //ExpressionLabel
and access it then with subfield(getcurrentfield(DimGroup), '/', -1)
- Marcus
No Sunny,
I have tried this earlier also but only A and C I found in result
, not B which I am still in search of.
Hi Marcus,
GetCurrentfield and subfield(getcurrentfield(DimGroup), '/', -1) gave same result..
Did you adjust my generic example to your existing group and expression?
Beside them you don't need it mandatory in your case if you creates an extra numeric month-field within the script maybe within a master-calendar: How to use - Master-Calendar and Date-Values.
- Marcus
Would you be able to share a sample to check this out?