Forum Discussion

Anthony_W's avatar
Anthony_W
Icon for Helper I rankHelper I
9 years ago
Solved

R Scatter chart –filter x and y from same column with different slicers

Just say I have a data table setup like the following: Index Month Year Parameter_Y Value_Y 1 January 2015 Revenue 100 2 January 2015 Profit 20 ...
  • Anthony_W's avatar
    9 years ago

    I have further investigated my problem and have come up with a workable solution.  I thought I should put it forward just in case anyone else has a similar problem.

     

    I created a table that lists the slicer parameters such that the Parameter X values repeat for all parameter y values as indicated in the table below. 

    Parameter_XParameter_Y
    RevenueRevenue
    RevenueProfit
    RevenueExpenses
    RevenueTax
    RevenueWages
    ProfitRevenue
    ProfitProfit
    ProfitExpenses
    ProfitTax
    ProfitWages

     

    The columns from the above table are fed into the R Scatter chart. Slicers are created for Parameter_X and Parameter_Y.  This means the requires parameters are supplied to the Scatter chart code. The R code reads the required source data directly from a CSV file (using read.csv()). The X, Y data for the Scatter chart is filtered from the CSV data.

     

    And now the Scatter chart reacts to variations in the selecter Parameter_X and Parameter_Y value.