Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am not new to QlikView, but I'm just trying out and learning some things which I haven't worked with before,
so maybe this is the best place to ask this kind of question:
I am just working through the exercises in the book "QlikView for Developers Cookbook".
My question is with the "waterfall chart": That in itself is pretty easy to do - but I tried to combine it
with some tricks from other recipes in the book:
- I removed the legend and placed the labels directly on top of the bars instead -> that worked well enough.
- Then I tried to implement some pop_up_labels to show the percentage (Sales is 100%, so I wanted to show what
percentage is removed for COGS, Expenses and tax and what percentage is the net_profit) -> that worked well,
too - in principle - but the custom_popup is displayed when I hover over any of the bars - no matter which
one. I cannot distinguish. That's probably because there is no dimension here. I tried to make the display
dependent on the category, but that did not work. All that is not a great Problem, but it might be nice to have five individual Pop_ups instead of one big one.
I then tried to redo the same thing with a real dimension,
but then I ran into difficulties implementing the offset.
=> Can that be done using a dimension so it would be possible to display one individual pop_up on every single bar? That might be
even better than having the Labels on top of the bars.
Thanks a lot!
Best regards,
DataNibbler
Think, that you cannot calculate the offset dynamically with SET.
Have played around and created variables, like
iOffset1: = 0
iOffset2: =SUM(IF (Category = 'Sales', Value))
iOffset3: =SUM(IF (Category = 'Sales', Value)) - SUM(IF (Category = 'COGS', Value))
Putting then these variables into the Offset-expression:
= IF(Category='Sales', $(iOffset1),
IF(Category='COGS', $(iOffset2), //SUM({<Category={'Sales'}>} Value),
IF(Category='Expenses', $(iOffset3))))//SUM({<Category={'Sales', 'COGS'}>}Value))))
Delivers the waterfall with pop-ups as requested
Peter
Can you please post an example?
Hi Peter,
sure, I can post the whole app. There's no sensitive data, it's only inline_tables.
Just mind the Sheets - all the Charts I tried out myself are on the second sheet.
Thanks a lot!
Best regards,
DataNibbler
Think, that you cannot calculate the offset dynamically with SET.
Have played around and created variables, like
iOffset1: = 0
iOffset2: =SUM(IF (Category = 'Sales', Value))
iOffset3: =SUM(IF (Category = 'Sales', Value)) - SUM(IF (Category = 'COGS', Value))
Putting then these variables into the Offset-expression:
= IF(Category='Sales', $(iOffset1),
IF(Category='COGS', $(iOffset2), //SUM({<Category={'Sales'}>} Value),
IF(Category='Expenses', $(iOffset3))))//SUM({<Category={'Sales', 'COGS'}>}Value))))
Delivers the waterfall with pop-ups as requested
Peter
Thanks Peter!
I still have to give it a think, but in principle it works.
I always try to create every variable I Need in the script, never on the GUI. That function seems to be available only on the GUI, but I fixed that. Variables can be written in the script in a way so they are then evaluated on the GUI.
It seems to be dependent on what design you choose for the Chart - I've found one of the 3D designs where it does not work - but well, that's not so critical. So that's the way to implement individual Pop_up_Labels in a waterfall chart.
Best regards,
DataNibbler