
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Default filter
Hello,
I have used filter panes in one of my sheet in qliksense. One of the filters is to select Gender. The filed name in my data source is Gender and it has rows for F (as female) and M( as male). Previously, I had this expression behind my filter
if(Gender='F','Female',if(Gender='M','Male')). it works fine.
Now user wants that every time they open the sheet it filters out the report automatically or by default to Male. and later, if they need then change and select the Female option in the filter.
I have set this variable in the main section in data load editor SET vDefaultFilter='Male', and modify the expression like this: if(Gender='F','Female','$(vDefaultFilter)')
the expression says ok but it does not filter data by default to Male. I still need to go and select Male option.
could someone help please?
Thank you!
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you replace in your script by the correct value (if(Gender='F','Female',if(Gender='M','Male')) as Gender)
then you can create an action
Action : select values in a field
Field : Gender
Values : Male

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @pravinboniface for the response. I tried using sheet action as you suggested but it still won't select the option I want by default. Here are the ways I tried but both ways did not work. I am new to Qliksense so maybe I am missing a step. Please let me know how I can resolve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should change the value of Gender directly on your script to avoid having to replace F by female in every expression.
That way you can have a new field that has the value female or male and work directly with that field.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the response! So you mean if I did not have If condition in my expression, the default filter would work! I dont think the problem is in my filed name being F for Femal or M for Male. Let's say I don't add the If condition, now my filter pane shows like this:
And I set a variable like this:
SET vDefaultFilter= 'M'
what can I do to make the sheet select M by default whenever user opens the sheet?
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
if you replace in your script by the correct value (if(Gender='F','Female',if(Gender='M','Male')) as Gender)
then you can create an action
Action : select values in a field
Field : Gender
Values : Male

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you so much. It worked. I really appreciate your help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
similar to my first question, I am applying default filter to my sheet but this time I have several filters. so I wanted to apply actions to my sheet again.
First filter:
Action : select values in a field
Filed name: FY
The value I want to show is the current year, so I wrote this formula in the value section:
FY= '$(=Year(Today()))'
Second filter:
Action : select values in a field
Field: Period
The value I want to show is the pervious month, so I wrote this formula in the value section:
Period='$(=MonthStart(Today(), -1))'
other filters:
Action : select values in a field
Field: ACC_Type
Value: A
Action : select values in a field
Filed: Level
Value: Level 1
when I exit and come back to the sheet, by default ACC_Type and Level filter the sheet and select A and 1, but FY and Period won't be applied.
Just to try, I removed the formulas and instead just put 2024 as value for FY and 3 as value for Period, and it worked. It filters the table by default when I open the sheet, However, that is not what users wants. They want a dynamic default filter.
let me know how to resolve this.
thank you for your help in advance!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Anyone any idea please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you update your script with the correct value assignment (if(Gender='F','Female',if(Gender='M','Male')) as Gender), you'll be able to perform the following action:
Action: Select values in a field
Field: Gender
Values: Male
So yeah someone already given you similar answer like this.

- « Previous Replies
-
- 1
- 2
- Next Replies »