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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
johnpaul
Partner - Creator
Partner - Creator

How to show similar values as one (a bit like a fuzzy search)?

I have been asked by a new client who has been evaluating Tableau to find a way to represent data which might be similar as a single value.

This is similar to the classic 'power of gray' example of the Forearm injury which was spelt Hand, Hend etc.

However, this differs in that the users would like to find a number of values in a list box and then simply group them as one.

For example, if a drug was administered it might be Panadol or Tylenol etc, but the user is happy to select a number of similar paracetamol based drugs and simply create one value called 'Paracetamol'.

Apparently this is very easy to do in Tableau and there is no need to create a new field, such as a Drug Type field, as the user can do it all on the fly.

Anyone know how this could easily be done?

5 Replies
swuehl
MVP
MVP

Maybe using bookmarks?

SunilChauhan
Champion II
Champion II

May be you looking for

count( distinct Fieldname)

Sunil Chauhan
MarcoWedel

Hi John Paul,

you are asking for a very interesting feature indeed.

Let me propose this approach:

Suppose there is a "number" field which we want to group into different categories.

We add an input box bound to the variable vGroupName,

a Listbox "groupName" to select the different groups of numbers,

a table that shows what numbers belong to which group,

two charts that visualize the numbers and sums of the numbers by group

and a magic "new group of numbers" button that calls this vbs macro:

sub MakeGroup

  ActiveDocument.DynamicUpdateCommand("DELETE FROM tabGroups WHERE groupName = '$(vGroupName)'")

  for i = 1 to ActiveDocument.Evaluate("=getSelectedCount(number)")

  InsertValue = ActiveDocument.Evaluate("=subfield(getFieldSelections(number, ';'), ';' ,"&i&")")

  ActiveDocument.DynamicUpdateCommand("INSERT INTO tabGroups (groupName, number) VALUES ($(vGroupName), "&InsertValue&")")

  next

end sub

This macro populates the tabGroups table with a group name and the selected numbers.

We initiate the application using e.g. this script:

tabNumbers:

LOAD

  RowNo() as number

AutoGenerate 10;

tabGroups:

LOAD

  'one' as groupName,

  1 as number

AutoGenerate 1;

The result would look like this:

QlikCommunity_Thread_110794_Pic6.JPG.jpg

QlikCommunity_Thread_110794_Pic2.JPG.jpg

You then could select some numbers, enter a group name in the input box and press the "new group of numbers" button, which creates a new group consisting of your selected numbers and named as you entered in the input box.

QlikCommunity_Thread_110794_Pic3.JPG.jpg

QlikCommunity_Thread_110794_Pic4.JPG.jpg

QlikCommunity_Thread_110794_Pic7.JPG.jpg

This solution only works, if you can enable the dynamic update feature

QlikCommunity_Thread_110794_Pic5.JPG.jpg

on document as well as on server level and might be limited to the IE plugin due to the AJAX/macro issue.

hope this helps

regards

Marco

johnpaul
Partner - Creator
Partner - Creator
Author

can't use bookmarks, as you would need to apply multiple bookmarks for a number of different selections.

johnpaul
Partner - Creator
Partner - Creator
Author

Hi Marco,

Great idea - it works well on the desktop, but as you said, there will be issues with the AJAX client.

Thanks for your reply.