Skip to main content

So I have 18 locations on a line graph that users will be able to select between, and I want the colors to change based on selection to avoid duplicate colors as much as possible (if someone selects more than 10 lines, they'll get a duplicate, but the graph would be hard to read anyway with that many lines). So the top selected answer will always be ⌗1170aa, the second will be ⌗fc7d0b, etc.

 

I saw this thread: Dynamically change color or avoid duplicates in line chart, but I do not understand what a tc index is or how to use one. I don't know if there is a simpler solution that's been devised in the past three years?

 

Any help is much appreciated.

3 respostas
  1. 13 de jun. de 2024, 22:03

    @Abby Ebelherr​ 

    Hi, you may use:

    RANK_DENSE(SUM({FIXED [Location]:SUM([Count (Timeline)])}))

    Also, you may create a top N set:

    a. Right Clic on the Location field in the data pane, select create set:

    b. Create a set by top N. In this case I have created a parameter TOP:

    @Abby Ebelherr​ Hi, you may use:RANK_DENSE(SUM({FIXED [Location]:SUM([Count (Timeline)])}))Also, you may create a top N set:a. Right Clic on the Location field in the data pane, select create set:b.c. Create a calculated field to group locations not in top N:

    IF [Location Set] THEN [Location] ELSE "Other" END

    d. Build your Viz:

    imagee. Add filters to the context:

    imagef. Change the calc of the RANK field:

    imageAttached you will find the workbook.

     

    If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

     

    Regards,

     

    Diego Martinez

    Tableau Visionary and Forums Ambassador

0/9000