Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Use created expression as field in chart?

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,

3 Replies
MK_QSL
MVP
MVP

Can you upload your sample data file or qvw?

Not applicable
Author

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

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

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