Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
imtiaz_ullah
Creator
Creator

Apply default filter (today) on Sense application

Hi guys,

In the same way we are able to create defaults in QV, does anyone know of a workaround to create similar functionality in QS?

I would like my applications to open up on a default filter applied on Date.

Thanks

Immy

1 Solution

Accepted Solutions
Michael_Tarallo
Employee
Employee

So just to break it down for you - Set Analysis is not entirely difficult once you understand the structure - I created a video here on it - if you have not seen it:

A Beginners' Introduction to Set Analysis

See attached example of using today (sheet 2 in the app) - this is just using Set Analysis to get the data for today's date.

I also included another example (Sheet 1) - which shows how to use default value within a chart as described in the other reply.

This is much more straightforward if you only require to use TODAY in the chart such as:

Sum({<OrderDate={'3/24/2015'}>}Sales)

But when you use a function instead of a literal you must use this expansion syntax that looks like this:

Sum({<OrderDate={'$(=Today())'}>}Sales)

This is a Dynamic Set Analysis Expression -- you put functions in between the single quotes using a $(= somefunction())  - then what is between that can be evaluated.

Hope this is easier and more straightforward. You may want to update the CORRECT and HELPFUL answers - if this one is more like what you are looking for.

Regards,

Mike

Regards,
Mike Tarallo
Qlik

View solution in original post

10 Replies
imtiaz_ullah
Creator
Creator
Author

Hey Mike,

OK, I see now. So in essence I can set variables within the app load and then reference these within the app.

In order to set the variable I need to use the IF expression across every visualization though.

Going forward, do you know if QS will have something at a sheet level where I can apply the default once?

Thanks for your example, it's really useful.

Immy

Michael_Tarallo
Employee
Employee

Hi Immy - I updated the Qlik Sense (.qvf) app in the original reply with a new one that allows you to have a default selection(s) AND use the same chart to show additional selection(s) - if one is to use a list box or visualization to change the selections.

You can copy to C:\Users\<user profile>\Documents\Qlik\Sense\Apps and refresh Qlik Sense Desktop hub (F5)

This is more of a script technique to allow the Set Analysis statement to be dynamic based on the selections from the interface.

So something like this for the measure of the chart object would look like:

Easier version.

if(getselectedcount(CategoryName) = 0, Sum({$<CategoryName={$(DefaultCat)}>}Sales),Sum(Sales))

Hope this helps

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
Michael_Tarallo
Employee
Employee

Hi Immy,

In order to set the variable I need to use the IF expression across every visualization though.

Going forward, do you know if QS will have something at a sheet level where I can apply the default once?

Yes you can use the Master Items on the left side to define this Measure once as in:

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Regards,
Mike Tarallo
Qlik
imtiaz_ullah
Creator
Creator
Author

Hey, thanks Mike. I’ll take a look at the expression code (seems a little complex but will deconstruct) and see how I can re-use using my date dimension.

Thanks for your help and taking the time with the example, really appreciated.

Immy

Michael_Tarallo
Employee
Employee

So just to break it down for you - Set Analysis is not entirely difficult once you understand the structure - I created a video here on it - if you have not seen it:

A Beginners' Introduction to Set Analysis

See attached example of using today (sheet 2 in the app) - this is just using Set Analysis to get the data for today's date.

I also included another example (Sheet 1) - which shows how to use default value within a chart as described in the other reply.

This is much more straightforward if you only require to use TODAY in the chart such as:

Sum({<OrderDate={'3/24/2015'}>}Sales)

But when you use a function instead of a literal you must use this expansion syntax that looks like this:

Sum({<OrderDate={'$(=Today())'}>}Sales)

This is a Dynamic Set Analysis Expression -- you put functions in between the single quotes using a $(= somefunction())  - then what is between that can be evaluated.

Hope this is easier and more straightforward. You may want to update the CORRECT and HELPFUL answers - if this one is more like what you are looking for.

Regards,

Mike

Regards,
Mike Tarallo
Qlik
Not applicable

can you please explain me how we can set the default selections.

Not applicable

If possible can you explain me step by step.

Michael_Tarallo
Employee
Employee

Hi Chinna - I responded to you in this post: http://community.qlik.com/message/738892#738892 with a sample and explanation. 🙂

Mike

Regards,
Mike Tarallo
Qlik
imtiaz_ullah
Creator
Creator
Author

Thanks Mike. Yes I watched tour set analysis video. I stumbled on it a while ago when I was looking for something else on the qlik support site.

I am fine with basic set and will get up to speed on more complex ones as I dig deeper.

It's just as a sql coder, this is just something new to learn. I just got to grips with DAX and then we canned that project in favour of Qlik.

Thanks again for the responses and examples. They really are of a superb quality.

Immy

On the move