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

Creating a bar chart with 2 dimensions and 2 expressions


Hello everyone,

I am new to QlikView and i am trying to create a bar chart with two dimensions from two different tables, and both dimensions has the same values. I also create two expressions to count the total of each one.

The chart is presenting the correct values, however it displays the same value in each line, as you can see in the print screen below:

tempo.png

When i create the chart using only one dimension and one expression, the chart is displayed correctly, as shown in the print screen below:

tempoone.png

What i have to do to show both dimensions in one single line as presented in the chart above??

Thanks in advance,

Rodrigo

30 Replies
Not applicable
Author

I did try the trellis bar with the app you sent and it does work but do not believe it will present the data in the format you are looking for

Not applicable
Author

Yes, you are right.. But when i create 1 dimension and 2 expression, the second expression is showing the total value (i.e. 79), and it was suppposed to show the value of each one, as it shows for the first expression.

Not applicable
Author

how are you creating the one dimension?  are you picking one of the exising from the 2 tables (they do not appear to be linked) or are you creating a new common dimension acreoss the 2 tables

Not applicable
Author

I am picking one of the existing from the 2 tables, and yes, they are not linked.

Not applicable
Author

I believe that is what is causing your issue - the tables should be linked (unless there is a reason not to associate and link them) and the 2 expressions need to apply to a common dimension

You can try concatenating the 2 tables together along with the single dimension

Not applicable
Author

Hi Adam,

Now both fields have the same name and it is a primary key, as you can see below:

primarykey.png

And now the table are linked:

tabelas.png

When i try to create the expression to count this field, QlikView show the following message:

"You are trying to use a expression that is not defined for a single variable specified.

To use this variable in expressions counting the ocurrence number, please read the field a second time with a new name from your primary table."

Once the fields have the same name and the tables are linked, it is not possible to create 2 expressions, cause now i have only one single dimension that come from 2 tables.

Any suggestion to solve this?

Thanks,

Rodrigo

Not applicable
Author

what about creating a unique key for the tables, such as a concetenation of each field from the table.  You would then have your expressions based on the individual fields, like earlier - sorry for any confusion

Not applicable
Author

Thanks for your quick answer Adam.

Please, could you help me telling me how concatenate works in QlikView.

Thanks!

Not applicable
Author

basically in your load script the 2 fields you want to concatenate together in each would look similar to

fieldA&fieldb as KeyField

fielda and fieldb would be the 2 fields being concatenated and KeyField would be the field name you want to call the new field made up of the 2

Not applicable
Author

I am little confused...

How will i concatenate fielda and fieldb if they have the same name in both tables??

I have made LOAD from two tables which has the same field. In which LOAD should i concatenate?

Thanks