How to make a list of sum with related children, with condition

Aurelien
Google Developer Expert
Google Developer Expert

Hi AppSheet Community,

I have a question regarding an optimization I would like to make.
This is for a sandbox app, no urgence.

Context: Time tracking app, using quickchart.io for aggregating data per activity type.
Goal: I would like to find a better way to express the data list for the chart.
Please note: Iโ€™m aware of the chart features, Iโ€™m just experimenting
Current Table structure:

I currently get this:
3X_8_5_853738699265b0e1e3829ee4c61b0074f5446dd3.png

With these virtual columns expressions:
[ChartImage]

ENCODEURL(
  CONCATENATE(
    "https://quickchart.io/chart/render/zm-e933be74-84a0-4501-8a40-5007ec396b97",
    "?title=","Semaine "& [Week_Num],
    "&labels=",[Chart_Label],
    "&data1=",[Chart_Data]
  )
)

[Chart_Label]
UNIQUE([Related Tasks][Activity_Type])

[Chart_Data]

UNIQUE(
  IF(ISNOTBLANK(INDEX([_THISROW].[Chart_Label],1)),
    LIST(
      SUM(
        SELECT(
          Tasks[Total_Hours],
          AND(
          	INDEX([_THISROW].[Chart_Label],1)=[Activity_Type],
          	**otherConditions**         )        )      )
    ),
    LIST("")
  )
  +
  IF(ISNOTBLANK(INDEX([_THISROW].[Chart_Label],2)),
    LIST(
      SUM(
        SELECT(
          Tasks[Total_Hours],
          AND(
          	INDEX([_THISROW].[Chart_Label],2)=[Activity_Type],
          	**otherConditions**             )        )      )    ),
    LIST("")
  )
  +
  (**etc**...)
)
-LIST("")

Big question, now:
Would there be a better way to proceed ?
I would like to express dynamically the [Chart_Data] expression, because here Iโ€™m limited.

  • Letโ€™s say I stick to 2 activities ==> current expression would do the job
  • letโ€™s say I have 5 activites ==> current expression is missing data

Thank you in advance for your help !

0 1 95
1 REPLY 1

Steve
Platinum 4
Platinum 4

Thereโ€™s really no significantly better approach that I can see.

Top Labels in this Space