Draw the customer lifetime value (LTV) ranking as a bar chart card: one bar per customer, the highest first.
**Call it once, after `well_measure_customer_ltv`, and send no figure.** It runs the measure itself for the workspace of the call and draws that result, so every name, flag and LTV on the card is the server's. You pass only: `window` as the measure's result echoed it (`from`, `to` and `month_count`), `counterparty_alias_sets` exactly as you passed them to the measure, the `currency` the card draws, `left_off_currencies` and `conversions`. Read the figures for your answer from the measure's result, not from this tool's. Do not call it when the measure returned no row: say there is nothing to rank instead.
**One currency per card.** Set `currency` to the currency the card draws. Every other currency in the measure's `currencies` goes in exactly one of two places. Convert it: add a `conversions` entry with the rate into `currency` and its date, from the currency conversion step, and the tool applies it to each customer's LTV. Or leave it off: name it in `left_off_currencies`, which keeps its customers off the card, because Well has no rate for it or because converting it is not allowed. The card's own currency is never converted and never left off. A card that converts draws only when no currency on it, the card's own currency included, has more than 100 customers, because the measure cuts rows past that. Otherwise draw the card's own currency alone and name the others in `left_off_currencies`.
The card draws at most 12 customers, never a summed "other" bar, and its small form quotes the average LTV per customer. The result states `average_ltv`, `customer_count` (the customers the average covers) and `left_out_count` (customers not drawn): say how many customers the card leaves out when it is above zero.
REFUSED rather than drawn:
- a window that reaches the running month or covers more than 60 months
- a measured currency that is neither converted nor left off, or a currency the measure did not find
- the card's own currency in `left_off_currencies` or in `conversions`
- a rate more than 1% away from Well's stored rate for the pair on its rate date, a rate dated outside the window's last complete month, or two rates for one currency
- a card that converts when the measure cut rows from a currency on it
Because the measure runs again here, a ranking reads the invoices twice. That is by design: it is what ties the card to the server's figures.
When `party_scope.side_unknown` is true the workspace has no resolved own company, so no side filter was applied and the ranking covers invoices on both sides. Say the side is unknown, never that these are the customers' figures.
When the token authorizes one workspace, call this directly — no workspace call is needed first. When it authorizes several, this read will not guess which one you mean: pass `workspace_id` on the call.