Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lalita_sharma
Contributor III
Contributor III

set expression to filter on dimension only table

I have data set  as below.

WorkstreamReporting DateNameDescriptionCompletion Date
W130/07/2021AL20/05/2021
W130/07/2021BM24/05/2021
W130/07/2021CP20/05/2021
W123/07/2021AL20/05/2021
W123/07/2021BM19/05/2021
W116/07/2021AL20/05/2021
W116/07/2021BM19/05/2021
W230/07/2021DQ11/05/2021
W230/07/2021ER24/05/2021
W230/07/2021FS11/05/2021
W223/07/2021DQ11/05/2021
W223/07/2021ER19/05/2021
W216/07/2021DQ20/05/2021
W216/07/2021ER19/05/2021

I want to display this data in a straight table with fields  Name, Description and Completion Date only with below conditions.

When no filter is selected on the filter pane, I want the table to display only records where workstream = W1 and Reporting Date = latest Date. When a filter is selected on the table all records of that Workstream and Reporting Date must be displayed. Could you please let me know how I can achieve this using set expressions. I am confused on how to apply set expression on a dimension only table.

The output should look like below when no filters are selected on filter pane. Thanks

NameDescriptionCompletion Date
AL20/05/2021
BM24/05/2021
CP20/05/2021
Labels (1)
1 Solution

Accepted Solutions
stevejoyce
Specialist II
Specialist II

I may have miss-interpreted, i was doing max completed date.  

I'd create a variable called vMaxReportingDate:  =date(max([Reporting Date])) //global calculation of max reporting date based on selections.

 

The calculated dim would be:  =Aggr(only({<[Reporting Date] = {'$(vMaxReportingDate)'}, Workstream={'W1'}>} [Completion Date]), [Completion Date], Workstream)

View solution in original post

4 Replies
lalita_sharma
Contributor III
Contributor III
Author

@sunny_talwar  I have seen excellent answers from you on set expressions in qlik community. Could you please help me with the above query?

stevejoyce
Specialist II
Specialist II

You can use a calculated dimension and on the calculated dimension, uncheck Include null values.  Add Name, Description as natural dimensions.  For Date you can have 2 versions but only one at a time will display using "Show column if", you can adjust the condition to what makes sense for the sheet/app.

Completed Date (max date only)

  Calculated dim: =Date(Aggr(max({<Workstream={'W1'}>} [Completion Date]), Name, Description)) //getting max completed date for each Name and Description where workstream = W1

  Show Column If: =not(GetSelectedCount(Description)>0 or GetSelectedCount(Name)>0)

Completed Date (all dates)

  Dim: [Completed Date]

  Show Columnn If: =GetSelectedCount(Description)>0 or GetSelectedCount(Name)>0

stevejoyce
Specialist II
Specialist II

I may have miss-interpreted, i was doing max completed date.  

I'd create a variable called vMaxReportingDate:  =date(max([Reporting Date])) //global calculation of max reporting date based on selections.

 

The calculated dim would be:  =Aggr(only({<[Reporting Date] = {'$(vMaxReportingDate)'}, Workstream={'W1'}>} [Completion Date]), [Completion Date], Workstream)

lalita_sharma
Contributor III
Contributor III
Author

Thank you @Stevejoyce

This worked perfect for me