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

Selected Date Period

My Problem is as follows:

I have a table where I want to show sales. It should be possible to show the sales by picking a specific year or by picking a time period. Furthermore there should be the possibility to select a certain customer. And there is the main problem: a specific customer is not buying products everyday. For example:
Customer A buys goods on the 5th and on the 12th of September 2020.
If I pick the daterange of the 1st to 30th September of 2020, Qlik only shows the range from the 5th to the 12th. Because - obviously - the customer only bought goods on these two days. Then the header of the column is 'Sales from the 05.09.2020 to the 12.09.2020'.

(Variables are vDateMin=min(Calendar.Date) and vDateMax=max(Calendar.Date))

My intention is that the header shows the selected time period -> 'Sales from the 01.09.2020 to the 30.09.2020'

So, in the background Qlik selects only the days where sales have taken place, but on the surface one should see the originally selected time period.

Is there a way to solve my problem via Variables?
I tried several options of getselectedcount or other getselected field functions. But none of them worked.

I hope anyone can help me.

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

If I understand your question correctly, I think you need to use the 1 identifier to ignore all selection and then include Calendar.Date in the set analysis to apply any selections made on Calendar.Date (or whatever date field you are using in your filter.

vDateMin = min({1<Calendar.Date=$::Calendar.Date>} Calendar.Date)

vDateMax = max({1<Calendar.Date=$::Calendar.Date>} Calendar.Date)

View solution in original post

1 Reply
GaryGiles
Specialist
Specialist

If I understand your question correctly, I think you need to use the 1 identifier to ignore all selection and then include Calendar.Date in the set analysis to apply any selections made on Calendar.Date (or whatever date field you are using in your filter.

vDateMin = min({1<Calendar.Date=$::Calendar.Date>} Calendar.Date)

vDateMax = max({1<Calendar.Date=$::Calendar.Date>} Calendar.Date)