Say we have a table of products and the year in which each product was sold. Using Qliksense, I would like to add a column that concatenates all products that were sold up to the respective year.
year | product |
---|---|
2020 | A |
2021 | B |
2022 | C |
Desired outcome would be:
year | product | concatenate_products |
---|---|---|
2020 | A | A |
2021 | B | A-B |
2022 | C | A-B-C |
See below for what I tried so far. It gave error "invalid expression".
Load
*,
if(RowNo()=1, 'A', Concat(distinct Peek(concatenate_products), product)) as concatenate_products
resident Table;