Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
morenoju
Partner - Specialist
Partner - Specialist

Dimension on a chart based on IDs but showing names

Hi all,

I have a list of items to display as x-axis on a chart. In my table I have a field for the id and a field for the name of the item (item.id, item.name).

The ids are unique, but the names are not. So I can have:

(item.id, item.name) = (1001, 'Name A')

(item.id, item.name) = (1002, 'Name A')

(item.id, item.name) = (1003, 'Name A')

(item.id, item.name) = (1004, 'Name B')

(item.id, item.name) = (1005, 'Name C')


On the x-axis I want to show the names of the items. But if I put "item.name" as dimension, in the example I only get three points, because Qlik groups 1001, 1002, 1003 for having the same name.


How can I make that Qlik uses the ids but displays the names to the user?


I'm attaching a sketch of what Qlik is doing and what I'm trying to get.


Thanks!

1 Solution

Accepted Solutions
OmarBenSalem

Here's an example on how u should treat such cases:

load Name,Dual(Name,Id) as NewNameField, Id, Measure Inline [

Name, Id, Measure

a,1 ,100

a,2,200

b,3,300

c,4,500

c,5,200

];

Now create a bar chart :

as dimension: NewNameField

as Measure: sum(Measure)

result:

Capture.PNG

View solution in original post

3 Replies
Digvijay_Singh

While loading use Dual(item.name,item.id) as item.name. This will make the field display Name but use ID in calculation etc.

OmarBenSalem

Here's an example on how u should treat such cases:

load Name,Dual(Name,Id) as NewNameField, Id, Measure Inline [

Name, Id, Measure

a,1 ,100

a,2,200

b,3,300

c,4,500

c,5,200

];

Now create a bar chart :

as dimension: NewNameField

as Measure: sum(Measure)

result:

Capture.PNG

morenoju
Partner - Specialist
Partner - Specialist
Author

Works great. Thank you guys!