Skip to main content

I have a line chart with running totals by group. To allow users to zoom in, I am attempting to follow this post from the Flerlage Twins to truncate the Y axis without overexaggerating the trends. I thought I had it working because the plot did shift up but, per the label on the reference line, the math ain't actually mathin'. I've tried various iterations of the calculation but can't get it to work. The calc I am using to get the plot below is

window_min(RUNNING_SUM(sum([Value])))-(window_max(RUNNING_SUM(sum([Value]))) - window_min(RUNNING_SUM(sum([Value])))) * 2 

Window calcs for running sums not working

By toggling the calculation in the reference line between min/max, I'm able to draw a line at the min and max of the entire plot, but I'm unable to actually isolate those points to use in calculations. I'd appreciate any help! 

 

#Tableau Desktop & Web Authoring

2 件の回答
  1. 8月20日 23:18

    Hi,  @Xin Yuen

    Kevin’s method produces the following results: the minimum value across the entire view is 85,951, and the maximum is 131,994. 

     

    85,951 − (131,994 − 85,951) × 2 = −6,135 

     

    Since the article takes the larger of this value and 0, the lower bound of the Y‑axis becomes 0 in this case. 

     

    Here, I’m introducing an alternative workaround. This approach assumes that all values used in the RUNNING_SUM are positive and that the cumulative values do not decrease along the Timepoint. 

     

    Under this assumption, the overall minimum of the cumulative values can be taken from the first Timepoint of each Year, and the overall maximum can be taken from the yearly totals. These can be obtained using LOD calculations and then applied to the same formula used in the article. Please refer to the sample. 

     

    <sample>Hi, Kevin’s method produces the following results: the minimum value across the entire view is 85,951, and the maximum is 131,994.

    <calc>image.pngimage.pngimage.png

     

     

     Also, since unverified AI‑generated answers are increasingly being posted, please be cautious with responses that do not include concrete samples. 

0/9000