Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to group the legend values !

hi ,

i am stuck with a scenario.

I have a bar chart showing legend values of many in the list.

The requirement is I have to group them accordingly. in my case I have stats for (Chrome, IE, Safari etc) and its various versions.

How to group all chrome versions to one Chrome and IE versions to IE etc;

Here is the screenshot.

Any one can help me pls.

5 Replies
its_anandrjs

Can you share some data or you can try this way in the load script to add another field as bucket

Load

If(WildMatch(FieldName,'Chrome*'),'Chrome',

If(WildMatch(FieldName,'IE*'),'IE',

If(WildMatch(FieldName,'Safari*','SAFARI*'),'Safari','Other'))) as BrowswerBucket

From Source;

Kushal_Chawda

try this

If you want 3 buckets with rest of the browser as 'Others' then try below

Load ...

If(WildMatch(lower(FieldName),'*chrome*'),'Chrome',

If(WildMatch(lower(FieldName),'*ie*'),'IE',

If(WildMatch(lower(FieldName),'*safari*'),'Safari','Other'))) as BrowserBucket

From Source;


if you want 3 buckets with rest of the browser as it is then try below


Load ...

If(WildMatch(lower(FieldName),'*chrome*'),'Chrome',

If(WildMatch(lower(FieldName),'*ie*'),'IE',

If(WildMatch(lower(FieldName),'*safari*'),'Safari',FieldName))) as BrowserBucket

From Source;

Anonymous
Not applicable
Author

Thanks Anand,

Its a kind of worked for me.

But I am getting this strange behaviour,

Firstly Why i cant see any streak of yellow Firefox' in the chart.

And How can I sort the legend as the percentage like in my case I want IE, Chrome, Other, Firefox in this order.

In regards to the Firefox in the chart. there is data for this browser , I have individaully pulled into a different chart to see various versions of Firefox , and strangely I can see and same color for all the bars.

Can you please  help me.

regards,

Vamsi.demo.png

its_anandrjs

May be condition not get matched what is condition for that please check.

For sorting go to sort option properties of your bucket field and in the expression write


Match(BucketFieldm, 'IE', 'Chrome', 'Other', 'Firefox')


Or


Only( {1} Match(BucketFieldm, 'IE', 'Chrome', 'Other', 'Firefox') )


Anonymous
Not applicable
Author

Hi,

The Condition i have given there is

If(WildMatch(user_agent,'*Chrome*'),'Chrome',

If(WildMatch(user_agent,'*IE*'),'IE',

If(WildMatch(user_agent,'*Fire*',),'Firefox','Other')))

Used this Only( {1} Match(BucketFieldm, 'IE', 'Chrome', 'Other', 'Firefox') )

I am getting this, demo.png