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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Simple Question Primary Keys

This is probably an easy one...

Prior to using qlikview, when I needed to create reports (e.g. ASP.NET), I'd create a drop down list where the value = primary key of a table and the text = the name

Let's say I have a customer dimension that has the following fields (custID int, custname)

When I create a ListBox, I want to display the custname. This is really easy. However, if two customers have the same name (very possible), I want to see two records in the ListBox.

How can I achieve this in Qlikview?

Thanks!

1 Solution

Accepted Solutions
Not applicable
Author

use a table box instead, and display custId and custname

View solution in original post

7 Replies
Not applicable
Author

use a table box instead, and display custId and custname

Anonymous
Not applicable
Author

Or, you can use straight table with custId as dimension and custname as expression, and hide custId. Looks more like listbox.

biester
Specialist
Specialist

Or you could use a custom expression as e. g.

= custID & ' : ' & custname

as base of a ListBox.

At least theoretically this should work, but I'm afraid there's an issue with QlikView 9 with this ListBox Espression. I'll harangue the support team on this tomorrow ....

Rgds,
Joachim

johnw
Champion III
Champion III

I sometimes load codes and descriptions into a single field in my script, either "description (code)" or "code - description" depending on whether the code or the description is more commonly used, or depending on how users are used to looking at the data in other systems. I'm guessing that a straight table is closer to what you're after here, though.

Anonymous
Not applicable
Author

Another approach is to use dual() to create a field for selecting the report in the script.

dual(CustomerName, CustomerID) as NameSelect

This way you will display all duplicates of CustomerNames as long as they have different underlying CustomerID's.

Not applicable
Author

I prefer to use the listbox solution as search functionality is still available to the user; I also create a field like 'custno - custname'

Regards,

Gordon

Not applicable
Author

Wow, clearly there are a lot of options. Thank you everyone!