Discussion Board for collaboration related to QlikView App Development.
Hello, I am creating a stacked bar chart where it is one stacked bar that includes all items, in a range of years and total cost. I get an error in the calculation. How do I fix this?
Below is example data
Year | Item | Cost |
2020 | Box | 425 |
2020 | Pencil | 214 |
2020 | Chair | 453 |
2020 | Pen | 283 |
2021 | Box | 315 |
2021 | Pencil | 587 |
2021 | Chair | 752 |
2021 | Pen | 145 |
2022 | Box | 785 |
2022 | Pencil | 214 |
2022 | Chair | 567 |
2022 | Pen | 54 |
2023 | Box | 298 |
2023 | Pencil | 236 |
2023 | Chair | 5447 |
2023 | Pen | 987 |
2024 | Box | 14 |
2024 | Pencil | 52 |
2024 | Chair | 254 |
2024 | Pen | 789 |
2025 | Box | 45 |
2025 | Pencil | 145 |
2025 | Chair | 8 |
2025 | Pen | 369 |
2026 | Box | 25 |
2026 | Pencil | 4 |
2026 | Chair | 1258 |
2026 | Pen | 78 |
2027 | Box | 126 |
2027 | Pencil | 58 |
2027 | Chair | 24 |
2027 | Pen | 2523 |
Here is what I have under Used Dimensions --> Add Calculated Dimension:
=sum({<Year={'>=2020<=2024'}>}Cost)
Here is what I get:
You need multiple results to stack . why dont you add Year and Item in the dimension and use the expression
sum({<Year={'>=2020<=2024'}>}Cost)
Try this:
=aggr(sum({<Year={">=2020<=2024"}>}Cost),Item)
Hi I use double quote, and it worked: =sum({<Year={">=2020<=2024"}>}Cost)
Nothing is working for me.
The best avenue for you to receive further help would be to attach the QVW file or a sample that shows the issue, so folks can look everything over completely including the data model.
Regards,
Brett
You need multiple results to stack . why dont you add Year and Item in the dimension and use the expression
sum({<Year={'>=2020<=2024'}>}Cost)