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: 
Not applicable

Using field names as pivot table

I have an idea of essentially turning a straight table into a pivot table, but by using conditional dimensions. This should give the user the ability to see their data by different dimensions by toggling on or off a column. What I'm trying to do is first create a list of all of my fields by using a list box object with $Fields as the dimension. Then, in my straight table I put the needed dimensions and add a condional as "=if(GetFieldSelections($Field)='FieldName', 1,0)".

My problem is that this only currently allows me to toggle one column at a time, where I would love to be able to select multiple fields in my list and allow the user to decide which columns to show. By using IF statements in the conditional, I would have to write a complex script for each dimension and I imagine this could be very resource intensive. Is there a better way to do this?

1 Solution

Accepted Solutions
Gysbert_Wassenaar

See the Build Your Report option in the attached example. It uses the substringcount function instead of match, but there are more ways to skin a cat.


talk is cheap, supply exceeds demand

View solution in original post

3 Replies
stephencredmond
Luminary Alumni
Luminary Alumni

Hi,

Try something like this:

Match('Field2', $(=Chr(39) & Replace(GetFieldSelections($Field), ', ', chr(39) & ',' & chr(39)) & chr(39)))

'Field2' is the name of the field that you are testing for.

BTW, rather than use $Field, I might load a separate field with the list of fields that I want the user to select.

Regards,

Stephen

Stephen Redmond is author of QlikView for Developer's Cookbook
He is CTO of
CapricornVentis a QlikView Elite Partner. We are always looking for the right people to join our team.
Follow me on Twitter:
@stephencredmond

Gysbert_Wassenaar

See the Build Your Report option in the attached example. It uses the substringcount function instead of match, but there are more ways to skin a cat.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much for this! It's exactly what I was looking for, and I'm glad there was a much simpler solution that what I first planned.