Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content
Announcements
Solving the Informatica Dilemma: On-Demand Briefing - Watch On Demand!
cancel
Showing results for 
Search instead for 
Did you mean: 
Aprkturk
Contributor II
Contributor II

How to show two week interval instead of daily on line chart?

Hi,

I've a line chart as below. Can you explain to me please how to show two week interval instead of daily on line chart? It should be showed as 02.01.2025, 16.01.2025 and soon..Many thanks.

scr1.PNG

Labels (4)
10 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

What is the boundary of the interval? Is it the 2nd and 16th of every month? (Which would not always be 2 weeks for the second half of the day).  Or is it just intervals of 14 days starting from the earliest date or some other point?

-Rob

Aprkturk
Contributor II
Contributor II
Author

Hi,

it is just intervals of 14 days starting from the earliest date or some other point. That is why I gave an example like that 02.01.2025, 16.01.2025 and so on..Many thanks.

marcus_sommer

You may try to create an appropriate flag within the calendar and using it as condition within the expression, maybe like:

mod(rowno(), 14) as 14DaysFlag

and then:

sum({< 14DaysFlag = {"$(=min(14DaysFlag))"}>} Value)

Aprkturk
Contributor II
Contributor II
Author

Thanks but not working..

marcus_sommer

What happens and why does it not fit to your expectations?

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If you want to generate the interval dimension in the chart based on the current selections then you can use a calculated dimension like:

Date(MyDate - Mod(MyDate - Min(TOTAL MyDate), 14))

If you want to pre-generate the intervals in the script, you can do so like this. This gives you a fixed starting point that does not change with selections. 

Calendar:
// Sample calendar data
LOAD 
  Date(MakeDate(2024,11,30)+RecNo()) as MyDate
AutoGenerate 500;
 
Left Join(Calendar)
LOAD
  MyDate,
  Date(MyDate - Mod(MyDate - Window(Min(MyDate)), 14)) as Bucket
Resident Calendar;

 

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Aprkturk
Contributor II
Contributor II
Author

Hi,

Many thanks, it is working but also I need to add max date (selected from filter) to end of the line. In this example it should be ended at 21.05.2025 because 21.05.2025 has selected from filter. I mean, the combination should be start starting date, starting date + 14 and so on. + selected date from the date filter.

sa2.PNG

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Date(if(MyDate = Max(TOTAL MyDate), MyDate, MyDate - Mod(MyDate - Min(TOTAL MyDate), 14)))

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

Aprkturk
Contributor II
Contributor II
Author

Hi,

Thank you but same result..It is not working. Thanks again.