Qlik Community

Qlik Design Blog

All about product and Qlik solutions: scripting, data modeling, visual design, extensions, best practices, etc.

Employee
Employee

Set expressions section

Image Not found

One of my favorite new things in Qlik Sense is the Set Expression section available in the Expression editor.  

The Set expressions section let users add complex set analysis to the expressions without typing it, which seems to me like a fantastic addition for new Qlik Sense users. Users decide whether they want to insert the current selection or a bookmark as a set expression. If available, users can choose which alternate state to base the current selection or the bookmark on.  

 Screen Shot 2019-05-31 at 12.08.42 PM.pngThe “Set expressions” section is available in the Expression editor

How it works? 

Let us assume I have a chart that contains Sales by State and I want to add a simple condition to my expression where Year=2019. With Set expressions section a user could just select 2019 in the field Year as she would normally do and then pick “Use current selections” from the Expression editor. This will add the correct syntax into the expression. Something like:  

 

Sum({<Year={'2019'}>}[Actual Amount]) 

 

But if we add a bit of Qlik magic to it, then it gets more interesting, for example let say we want the Sales by State chart to show only the data for those Sales Reps that achieved their quota. (I’m using Consumer Sales app for this example) 

In the Sales Rep filter panel I can search those Sales Reps by using =sum([Sales Amount])>sum([Budget Amount]) in the search box. That will return the sales representatives that match that condition.  

 Screen Shot 2019-05-31 at 11.56.08 AM.png

 

 With this new feature adding a powerful set analysis to my expression gets easy, just by editing the chart expression for Sales and inserting the current selections I can achieve the example’s goal.

 

Screen Shot 2019-05-31 at 12.02.24 PM.png

 

Remember, you can also pick bookmarks and specify an alternate state if your app uses it. 

 

I hope you find it interesting. 

Arturo @arturoqv

2 Comments
Partner
Partner

Excellent post Arturo,

It's equally important to educate users on the importance of cursor when they wanted to insert  either  Use Current Selection or Use Bookmart. If users can't see the cursor after the opening bracket then the set expression will be inserted in the wrong place in the aggregation{<Year = {'2019'}>} SUM(SalesAmount). So users should click after the open bracket and see the cursor there before they insert the set expression.

 

0 Likes
822 Views
Employee
Employee

Thanks for your comment Gabriel,  right on point.

0 Likes
799 Views