Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have created a trellis chart where my 1st dimension is Region & 2nd dimension is Year. Everything works great.
My dashboard allows the user to select which periods to compare. For example, if they select 'Year', it will compare this year to last year's sales. If they select 'Quarter', it will compare this quarter to the same quarter of last year, etc.
I would like to enable this functionality on my trellis chart. In other words, I would like to replace the 'Year' dimension with something else. I tried this, but it didn't work:
If(vComparePeriod = 'Year', FiscCalYr,
If(vComparePeriod = 'Quarter', FiscCalQuarter,
If(vComparePeriod = 'Month',FiscCalMonth,
If(vComparePeriod = 'Week', FiscCalWk
)
)
)
)
Has anyone tried using a Trellis Chart with a calculated dimension?
To test for which dimension of a cyclic group is selected, use getcurrentfield(YourGroupName). Mind you, I'm not sure if we're on the right track at all, and this seem a bit too "brute force" to me, but continuing on since I'm not sure what else to do:
pick(match(getcurrentfield(YourGroupName),'FiscCalYr','FiscCalQuarter','FiscCalMonth','FiscCalWk')
,sum({<FiscCalYr={"$(CurrentYear)","$(PreviousYear)"}>} POSQty)
,sum({<FiscCalQuarter={"$(CurrentQuarter)","$(PreviousQuarter)"}>} POSQty)
,sum({<FiscCalMonth={"$(CurrentMonth)","$(PreviousMonth)"}>} POSQty)
,sum({<FiscCalWk={"$(CurrentWeek)","$(PreviousWk)"}>} POSQty))
I'm still on version 8.5 and haven't played with Trellis charts, but if you CAN'T do them with a calculated dimension, can you do them with a grouped dimension? Perhaps you could put these four fields in a group, and then use the group as the dimension.
Thanks John. I played around with that, but I'm not sure what to do with the expression. If it's just comparing years, the expression looks like this:
Sum({$<FiscCalYr={"$(CurrentYear)", "$(PreviousYear)"}>} POSQty)
I'm not sure how to test for which dimension in the cyclic group has been selected.
To test for which dimension of a cyclic group is selected, use getcurrentfield(YourGroupName). Mind you, I'm not sure if we're on the right track at all, and this seem a bit too "brute force" to me, but continuing on since I'm not sure what else to do:
pick(match(getcurrentfield(YourGroupName),'FiscCalYr','FiscCalQuarter','FiscCalMonth','FiscCalWk')
,sum({<FiscCalYr={"$(CurrentYear)","$(PreviousYear)"}>} POSQty)
,sum({<FiscCalQuarter={"$(CurrentQuarter)","$(PreviousQuarter)"}>} POSQty)
,sum({<FiscCalMonth={"$(CurrentMonth)","$(PreviousMonth)"}>} POSQty)
,sum({<FiscCalWk={"$(CurrentWeek)","$(PreviousWk)"}>} POSQty))
Cool!!!!! This will come in handy!