Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I'm relatively new to Qlikview and am trying to build a chart. My imported data have a field "Units". I created an expression "New Units" which revises the unit total based on product type. So, for example, Units is currently 60/40 Product Type A/B, and I multiply it so New Units shows Product A/B if their ratio were 50/50.
Now, I want to visualize Units and New Units as 2 stacked bars. I can make an expression with Units but New Units does not exist as an option. How can I use calculated fields as expressions in charts?
Thanks,
Can you upload your sample data file or qvw?
Hi Manish,
What i understood is that you have a field 'Units' and you are want to show 2 stacked bars for Unit and New Unit.
This can be achieved in bar charts by writing the 2 expression in dimension one for "Units" and another for "New Units" and stacking it for different dimensions.
If still have any doubt, you can send us the data sample or requirement documented.
Thanks
Syed Haji
Hi there,
I don't fully follow how you are deriving New Units from Units, but it sounds like you may be doing this in the front end?
The best place to create new fields is in the load script, for simplicity and performance.
To derive new fields you load script will need to look a bit like this (I've just used a Value multiplier as an example - your expression will differ):
LOAD
Product,
Units,
Units * Value as [New Units],
... rest of load script ...
After that script has loaded you will be able to sum Units and New Units in two different expressions and have them side by side on a bar chart.
When deriving new fields in this way it is imperative you ensure all field names are unique. If a field name is duplicated the load will crash out.
Hope that helps,
Steve