3 Replies Latest reply: Jul 4, 2012 6:25 AM by Ferran Garcia Pagans RSS

    Calculated Dimension... based on condition...



      I have a dataset containing the ages of a bunch of people. I also have these linked to Age Groups, i.e 0-10, 11-20, 21-30 etc etc. I have multiple Age Group Types, so the age group type described previously was 10 year incremental, but i also have a 5 year incremental group (0-5, 6-10, 11-15 etc etc), plus others.


      I have a chart with the dimensions AgeGroup & Gender. The expression is a simple count.


      For the chart to display correctly, i need to either select a single AgeGroupType, Or, Add the equivalent set analysis into my expression. What i WANT to acheive is...


      If a single AgeGroupType is NOT selected then by default use AgeGroupType X, else use whatever AgeGroupType is selected.


      I've tried building an 'If' statement into my expression but it just didnt work. it was something like...



      If(Count({$} Distinct [AgeGroupTypeName])=5


      ,Count(DISTINCT{$<AgeGroupTypeName={'Ten-year intevals'}>}EpisodeId)