0 Replies Latest reply: May 27, 2016 4:01 AM by Kalmer Kaljuste RSS

    10 max values as my dimension

    Kalmer Kaljuste

      Hello!

       

      I'm trying to use the sankey chart to create a Chart which shows the movement of the contacts from A to platform B.
      And i'm struggling with creating a dimension which would show my last 10 finished newsletters campaign_ID.
      So far i've tried to use the regular limitation which does not work as i want it to + i've used DUAL function to create the chart.
      But i can't seem to get more than the LAST finished campaign (aka the max(campaign_ID)). So here's my code:

       

      dual(

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 1),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 2),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 3),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 4),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 5),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 6),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 7),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 8),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 9),campaign_ID)>=1, campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 10),campaign_ID)>=1, campaign_title))))))))))

      ,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 1),campaign_ID)>=1, 1,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 2),campaign_ID)>=1, 2,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 3),campaign_ID)>=1, 3,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 4),campaign_ID)>=1, 4,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 5),campaign_ID)>=1, 5,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 6),campaign_ID)>=1, 6,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 7),campaign_ID)>=1, 7,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 8),campaign_ID)>=1, 8,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 9),campaign_ID)>=1, 9,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 10),campaign_ID)>=1, 10)))))))))))


      And i've also tried to use this:

      dual(

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 1),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 1))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 2),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 2))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 3),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 3))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 4),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 4))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 5),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 5))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 6),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 6))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 7),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 7))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 8),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 8))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 9),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 9))', campaign_title,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 10),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 10))', campaign_title))))))))))

      ,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 1),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 1))', 1,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 2),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 2))', 2,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 3),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 3))', 3,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 4),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 4))', 4,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 5),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 5))', 5,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 6),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 6))', 6,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 7),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 7))', 7,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 8),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 8))', 8,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 9),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 9))', 9,

      if(aggr(max({$<campaign_status={'finished'}>}campaign_ID, 10),campaign_ID)='=$(=max({$<campaign_status={'finished'}>}campaign_ID, 10))', 10)))))))))))
      But the it leaves the dimension totally blank. Any suggestions?