Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to avoid aggregations in Bar Chart

Hello, this is a sample of my problem

This is a simple table showing an ID, a customer and a value

MWSnap 20120508120048.gif

with a simple Bar chart using the expression sum(Value) i receive this obvious result:

MWSnap 20120508120229.gif

but i would like yahoo to be drawed 2 times, like in the table, each bar showing the value 5000

I don't want the ID field to compare in the chart

how can i obtain this result?

Attached the sample project

Thankyou so much!

L.

1 Solution

Accepted Solutions
erichshiino
Partner - Master
Partner - Master

HI, Lucky.

I think the chart might be confusing for users but if it makes sense in this case, you can use dual

Remove your original dimension and include a calculated one.

The syntax will be:

= dual ( Customer, id)

The expression will remain the same

hope this helps,

Erich

View solution in original post

6 Replies
subin6600
Creator III
Creator III

If you could add the ID as one of the expression IT might help you get it divided.

Hope it helps you!

Thanks/ Subin

Not applicable
Author

No, i cannot use the ID in the chart

erichshiino
Partner - Master
Partner - Master

HI, Lucky.

I think the chart might be confusing for users but if it makes sense in this case, you can use dual

Remove your original dimension and include a calculated one.

The syntax will be:

= dual ( Customer, id)

The expression will remain the same

hope this helps,

Erich

Anonymous
Not applicable
Author

Hi,

So you want the value of the ID by id shown per customer but you dont want to use the ID?

Then somehow you have to make the customer unique to seperate them.

(because now you ask the sum of the values per costumer, so Yahoo will be summed)

If you don't want to use the ID you could add something else to make it unique.

Take a look at this and let me know if it works for you:

TestTable:

Load          *,

                              '1'  as counter;

LOAD * INLINE [

    id, Customer, Value

    1548, google, 10000

    1578, yahoo, 5000

    1648, msn, 1000

    1487, yahoo, 5000

    487, altavista, 500

];

Join (TestTable)

Load Customer,

           Sum(counter) as UQ

Resident TestTable

Group by Customer;

Join (TestTable)

Load id,

                    IF(UQ =1, Customer, Customer& ' '& RowNo()) as Customer2

Resident TestTable

;


Drop field UQ, counter from TestTable;

This will create a new Customer field (named it Customer2) which adds the rownumber to the customer when there is more then 1 ID for this customer.

Maybe not the perfect solution but maybe you can work from here.

Anonymous
Not applicable
Author

Nice!

Not applicable
Author

Thankyou Shiino

this solved my problem