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

How to show all selected periods in Stright Table

Hi,

please let me know how to show all selected values in a Stright Table report. I've done an application, which will be displayed customers different dates in total. There is Selection list (load * inline  SelectionList) where the user can select periods. The user should be able to select all periods in Selection list (1-5). Now my application works fine if select only one SelectionPeriod.

SelectionList:
LOAD * INLINE [
SelectPeriod
1. Status1 (Today - 243)
2. Status2 (Today - 487)
3. Status3 (Today - 730)
4. Status4 (Today - 1095)
5. Status5 (Today - 1460)
];

This is the Straight Table Expressions:

=If(WildMatch(SelectPeriod, '*1.*'),
Sum(Aggr(Sum(DISTINCT(IF(TransactionDate <= (Today()-1) and Today()- 243<= (TransactionDate), BeingInStatus))), CustomerID)),
If(WildMatch(SelectPeriod, '*2.*'),
Sum(Aggr(Sum(DISTINCT(IF(TransactionDate <= (Today()-1) and Today()- 487<= (TransactionDate), BeingInStatus))), CustomerID)),
If(WildMatch(SelectPeriod, '*3.*'),
Sum(Aggr(Sum(DISTINCT(IF(TransactionDate <= (Today()-1) and Today()- 730<= (TransactionDate), BeingInStatus))), CustomerID)),
If(WildMatch(SelectPeriod, '*4.*'),
Sum(Aggr(Sum(DISTINCT(IF(TransactionDate <= (Today()-1) and Today()- 1095<= (TransactionDate), BeingInStatus))), CustomerID)),
If(WildMatch(SelectPeriod, '*5.*'),
Sum(Aggr(Sum(DISTINCT(IF(TransactionDate <= (Today()-1) and Today()- 1460<= (TransactionDate), BeingInStatus))), CustomerID)),
0)))))

 

The result should be like this (if select all SelectionPeriods):

CustomerIDStatusBeingInStatus
56000300611210
56000300612352
56000300613608
560003006141 058
Labels (1)
1 Reply
Brett_Bleess
Former Employee
Former Employee

Arto, I am not a very good developer, so I may be way off here, but I think the following Design Blog post may provide a potentially better way to do things:

https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130

If you want want to search around the blog area further on your own, use the following link:

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Hopefully this will help you get things on a track that will work for you.  My post will also kick things back up in the list, so someone else may have a read again and offer up something else too.  I realized the other thing may be the need for a Master Calendar, so here is the link to that post too:

https://community.qlik.com/t5/Qlik-Design-Blog/The-Master-Calendar/ba-p/1471527

Regards,
Brett

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.