Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Vladimir_Ermakov
Contributor II
Contributor II

Selection of Month-End / Quarter-End / Year-End via a single selection

Dear colleagues, good morning. Please, advise on the following topic.

I have a table with a timeline. I need to provide the user with a single filter-pane that will allow him to keep in the final table 

- all dates

- only month-end dates

- only quarter-end dates

- only year-end dates.

I've created the fields "daily", "month-end", "quarter-end" and "year-end" in the data load script, and they show flags 1 or 0. However, this approach results in 4 selections instead of in 1.

DateDailyMonth-EndQuarter-EndYear-EndData
31.12.20191111...
01.01.20201000...
31.01.20201100...
..................
31.03.20201110...

 

Alternatively, I can create a qualifier field, that will be a sum of flags, so it will show 4 for year-ends, 3 for quarter-ends, 2 for month-ends and 1 for other days. But then I somehow need to include ">=" into the dimension, because otherwise when the user chooses "1" for daily reporting, it will exclude month-ends, quarter-ends, and year-ends; and I don't know how to do that.

In SQL I would have solved that by creating a mapping table and left-join'ing it to the base table with a ">=" in ON operator; that would create extra rows, but still do the trick. However, as far as I understand, QlikSense only allows to JOIN / KEEP on an explicit match.

Would be grateful for any suggestions. Thank you.

Labels (1)
1 Solution

Accepted Solutions
Vladimir_Ermakov
Contributor II
Contributor II
Author

OK, I've received no reply, so I've solved it myself.

To the experienced users, this must be a pretty obvious solution, but I'll just post it here for the future reference of poor souls like me.

In short, I've kept the flag structure in my Facts table just as reflected above. I've also created a composite key for Daily|MonthEnd|QuarterEnd|YearEnd

DateDayFlagMonthEndFlagQuarterEndFlagYearEndFlagData
31.12.20191111...
01.01.20201000...
31.01.20201100...
..................
31.03.20201110...

 

Then I've created two more tables:

_ReportPeriod:

_Period_PeriodID
Day1
Month2
Quarter3
Year4

 

and the bridge to keep them together, also with a composite key to link to the Fact table.

_PeriodIdDayFlagMonthEndFlagQuarterEndFlagYearEndFlag
11000
11100
11110
11111
21100
21110
21111
31110
31111
41111

 

So, this works like a charm: the user has a filter pane for field _Period, and when he chooses a particular one, only the required Dates are retained in the visualisations and other filter panes.

View solution in original post

1 Reply
Vladimir_Ermakov
Contributor II
Contributor II
Author

OK, I've received no reply, so I've solved it myself.

To the experienced users, this must be a pretty obvious solution, but I'll just post it here for the future reference of poor souls like me.

In short, I've kept the flag structure in my Facts table just as reflected above. I've also created a composite key for Daily|MonthEnd|QuarterEnd|YearEnd

DateDayFlagMonthEndFlagQuarterEndFlagYearEndFlagData
31.12.20191111...
01.01.20201000...
31.01.20201100...
..................
31.03.20201110...

 

Then I've created two more tables:

_ReportPeriod:

_Period_PeriodID
Day1
Month2
Quarter3
Year4

 

and the bridge to keep them together, also with a composite key to link to the Fact table.

_PeriodIdDayFlagMonthEndFlagQuarterEndFlagYearEndFlag
11000
11100
11110
11111
21100
21110
21111
31110
31111
41111

 

So, this works like a charm: the user has a filter pane for field _Period, and when he chooses a particular one, only the required Dates are retained in the visualisations and other filter panes.