Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

arwinpabz
New Contributor III

Set analysis to filter fields in chart

Hi,

Would like to know on how can I filter the fields in Qliksense chart using set analysis.

Currently I am trying this code:

=If(vSourceType = 'Data 1', Only({$<SourceType = {"Data 1"}>}SourceType), Only({$<SourceType = {"Data 2"}>}SourceType))

What I want to return is when user select the Data 1 in selection, then Data 1 will only appear in SourceType field. Else, Data 2 in SourceType.

Thanks in advance!

1 Solution

Accepted Solutions
arwinpabz
New Contributor III

Re: Set analysis to filter fields in chart

I found the right answer somewhere in other post here in community.

I really appreciate your effort by replying  to this post and looking forward to learn more in Qlik!

View solution in original post

13 Replies

Re: Set analysis to filter fields in chart

Where is the above expression used? What exactly are you trying to display?

Highlighted
jmvilaplanap
Valued Contributor

Re: Set analysis to filter fields in chart

Hi,

I think is not necessary use "Set Analysis" if you put a list with values "Data 1", "Data 2" etc... and you force it to have one selected value... is enought, isn´t it?

Regards.

arwinpabz
New Contributor III

Re: Set analysis to filter fields in chart

It's Qliksense dashboard, when dashboard user select these selection, the export button would export the data which exclusively selected.

Selection.JPG

Don't know what is wrong in my expression in export button.

Expression.JPG

Re: Set analysis to filter fields in chart

Can you try this

=If(vSourceType = 'Data 1', 'Data 1', 'Data 2')

arwinpabz
New Contributor III

Re: Set analysis to filter fields in chart

Thanks for being patient, Sunny. When I use that expression and hit the download button, it return this data.

output.JPG

No more Data 2 in the field but the count is just the same. I guess it just replace the Data 2, not to export only the Data 1 exclusively.

Is there a set analysis that I can filter the field in Qliksense? Below expression is not working.

=Only({$<SourceType = 'Data 1'>-1<SourceType='Data 2'>}SourceType)

Re: Set analysis to filter fields in chart

But isn't vSourceType a variable? I am not sure I am able to follow what you are looking to do...

arwinpabz
New Contributor III

Re: Set analysis to filter fields in chart

Yes, vSourceType is a variable. This variable toggles if user select Data 1 or Data 2.

Selection.JPG

Then, expression you provided is what I used here.

download.JPG

But when I download the file, it shows me the whole data. Not filtered by Source Type which user selected.

Apologies if I made you confused.

Re: Set analysis to filter fields in chart

Source Type is an Island table? Is it not linked to your data model?

arwinpabz
New Contributor III

Re: Set analysis to filter fields in chart

It is linked in data model. It's actually part of link table.