Is there a reason why you cannot change the legend labels in a Period over Period chart type?

I'd love if there was a quick way you could change them like you can to the y-axis for example when you click the dropdown.

I know there is a way in a normal bar + line chart to make a beast mode for the time period you want and add it to series to manually plot the bar and line against each other a year apart but I have never been able to make that work.

Best Answers

  • ST_-Superman-_
    edited April 2023 Answer ✓

    Looks like the series that you were using is Year. I would try creating a calculated field. Assuming you don't have any future dates in your data you could do something like this:

    CASE
    WHEN
    DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 12 MONTH), INTERVAL DAYOFMONTH(CURDATE())-1)
    > DateField
    THEN 'Current'
    WHEN
    DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 24 MONTH), INTERVAL DAYOFMONTH(CURDATE())-1)
    > DateField
    THEN 'Previous'
    END

    You could then place this in your filter and select 'Current' and 'Previous'. Then use this field as your series as well. You can change the "Current" or "Previous" in the formula to whatever you want the label to say


    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
  • SayyedHussain
    SayyedHussain Member
    Answer ✓

    @jakebutterfield This may be able to work with variables and for that, you need to create two variables "Current year" and "Previous year" and then put them along with the BM to create a line graph.

    (CASE WHEN YEAR(Date) = CY*1 THEN IFNULL(Values)`,0) ELSE 0 END)

    (CASE when YEAR(Date) = PY then (IFNULL(Values)` ,0) ) else 0 end)


Answers

  • @jakebutterfield Domo's PoP charts are generally pretty rigid as far a customization goes, unfortunately. What have you tried in the bar + line charts?

  • This is as close as I have been able to emulate it, the problem is getting my most recent months to show up to the right with Mar '23 being in the furthest to the right. I have tried sorting by but have never been able to get it like the period over period chart which is exactly how I want it to look which is frustrating as all I need to do is change the legend labels.

  • ST_-Superman-_
    edited April 2023 Answer ✓

    Looks like the series that you were using is Year. I would try creating a calculated field. Assuming you don't have any future dates in your data you could do something like this:

    CASE
    WHEN
    DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 12 MONTH), INTERVAL DAYOFMONTH(CURDATE())-1)
    > DateField
    THEN 'Current'
    WHEN
    DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 24 MONTH), INTERVAL DAYOFMONTH(CURDATE())-1)
    > DateField
    THEN 'Previous'
    END

    You could then place this in your filter and select 'Current' and 'Previous'. Then use this field as your series as well. You can change the "Current" or "Previous" in the formula to whatever you want the label to say


    “There is a superhero in all of us, we just need the courage to put on the cape.” -Superman
  • Thanks for the replies, it helped me get further however, I have it graphed and instead of the Current and Previous being graphed on top of each other it is showing 24 months with previous being on the left and current on the right. Is there a way I can ensure them being in top of each other so i can see the current month vs the previous month? I am drawing blanks…

  • Here is the beast mode I have for previous/current

  • SayyedHussain
    SayyedHussain Member
    Answer ✓

    @jakebutterfield This may be able to work with variables and for that, you need to create two variables "Current year" and "Previous year" and then put them along with the BM to create a line graph.

    (CASE WHEN YEAR(Date) = CY*1 THEN IFNULL(Values)`,0) ELSE 0 END)

    (CASE when YEAR(Date) = PY then (IFNULL(Values)` ,0) ) else 0 end)


  • So I didnt use the variables for that @Sayyed007, but it helped me realize that my x axis was wrong. If I want 12 months to be graphed and have multiple years on it I needed to graph by a column with Month names in it, instead of a date column that includes years in it. This way I am able to graph side by side different years with the x axis consisting of just the 12 months.

    My month_year x axis allows me to get multiple years on it. Phew, what a relief. This has been my biggest learning curve since joining DOMO, getting time-series graphs to behave the way I'd like them too. But we live and learn. Thanks @Sayyed007 @ST_-Superman-_ & @MichelleH !