Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
Maybe using bookmarks?
May be you looking for
count( distinct Fieldname)
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:
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.
This solution only works, if you can enable the dynamic update feature
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
can't use bookmarks, as you would need to apply multiple bookmarks for a number of different selections.
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.