Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
casparhawkes
Contributor II
Contributor II

Using two fields as one dimension

Hi all,

I'm trying to use two fields as one dimension so I can have the total or use a filter pane to choose either of the fields. At the moment I have "Field 1", "Field 2" and "Total" as three separate fields. I have tried putting Fields 1 and 2 into a master dimension but to no avail. What's the best way to go about this? Apologies if the solution is already posted but I am unsure what to look for even.

Thanks in advance

Labels (2)
4 Replies
steeefan
Luminary
Luminary

The best way in my opinion is to already combine these two fields in the load script:

 

LOAD
  Field1 & ' - ' & Field2 AS Field3,
  ...
RESIDENT
  Table;

 

If that is not feasible, create a master dimension and define it as such: Field1 & ' - ' & Field2.

casparhawkes
Contributor II
Contributor II
Author

Thank you for your advice. Unfortunately, It's not quite what I was hoping for. The two fields are values connected to a day. Both field 1 and 2 will have a value for each given day. I was hoping to be able to use a filter pane to select field 1 or field 2 to see the given value for the selected day(s).  What do you reckon?

 

steeefan
Luminary
Luminary

Without knowing much about your data model, here is another suggestion:

FilterTable:
LOAD
  %Date,
  Field1 AS FieldFilter
RESIDENT
  Table;

CONCATENATE (FilterTable) LOAD
  %Date,
  Field2 AS FieldFilter
RESIDENT
  Table;

From the table you have, this script extracts both fields and puts them into a new table with both of the fields then having the same name. %Date would be the link to you original table. Is that more likely what you are looking for? If not, please provide more insight into your data model.

vinieme12
Champion III
Champion III

your use case is not very clear, can you post some example / mockup of what you are trying to achieve?

 field 1 or field 2 to see the given value for the selected day(s) 

are field1 and field2 Dimensions or Measures??

If you just want to show/hide either field1 or Field2 then create a variable with Dynamic Value as below

 

vChooseField   

Dynamic Value = 'Field1|Field2'

 

Use Variable input as DropDown list

 

Then in the Chart just  add $(=vChooseField) as dimension

you can then toggle between Field1 and Field2 using the dropdown

 

vinieme12_0-1705475609190.png

 

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.