Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Jack5
Contributor
Contributor

Chart does not display fully when selecting different option of 'date range' button (variable input)

Hello kind soul,

 

I would like to make a button that show a range of date only when showing a line chart, but I face a problems where my chart does not display fully when I select a other two variable button for the 'date range' in the variable input.

2b.png2m.png6bulan.pngvset.png

 

My variable name is = $(vdate)

In the Variable Input. I set the button in order of :

1. 6 month = '6 Bulan'

2. 2 month = '2 Bulan'

3. 2 week= '2 Minggu'

 

In the line chart expression, I set the expression like this:

Pick($(vdate), Sum({<"=Dual(Year([date])&'-'&Month([date]),MonthStart([date]))"={'2021-Apr','2021-May','2021-Jun','2021-Jul','2021-Aug','2021-Sep'}>}[cases_malaysia(j).cases_new]),
Sum({<"=Dual(Year([date])&'-'&Month([date]),MonthStart([date]))"={'2021-Aug','2021-Sep'}>}[cases_malaysia(j).cases_new]),
Sum({<"=(WeekStart(Today())-WeekStart([date]))/7"={'1','2'}>}[cases_malaysia(j).cases_new]))

 

I hope someone can help me resolve this situation, so I can display the chart fully when selecting other button. Thank You.

1 Solution

Accepted Solutions
mato32188
Specialist
Specialist

Right. Could you try to uncheck "Include zero values"?

mato32188_0-1633413197738.png

or play a bit with 

mato32188_1-1633413251018.png

 

Hope it helps.

m

ECG line chart is the most important visualization in your life.

View solution in original post

4 Replies
mato32188
Specialist
Specialist

Hi @Jack5 ,

I think that your chart works exactly how it should work. When you select 6 months, it shows 6 months, when you select 2 months, it shows 2 months, etc. Perhaps you want to highlight the period. In such case I would set the expression to Sum([cases_malaysia(j).cases_new]) and then set the color expression (appearance tab) i.e. pick(match('$(vdate)','6 Bulan','2 Bulan','2 Minggu'),blue(),red(),green()).

Hope it can help.

BR

m

 

ECG line chart is the most important visualization in your life.
Jack5
Contributor
Contributor
Author

Hi @mato32188 ,

Appreciate your prompt reply. Yes, the chart results works accordingly. Unfortunately for chart presentation, only  '6 Bulan' chart display fully after the button is clicked. Fit nicely to the square.

Whereas, results for '2 Bulan' and '2 Minggu' are skewed. The date for the duration does not fit the square. My intention to have the date duration adjusted to the square too. I hope someone could help me to find ways to fix it. Thank you.

mato32188
Specialist
Specialist

Right. Could you try to uncheck "Include zero values"?

mato32188_0-1633413197738.png

or play a bit with 

mato32188_1-1633413251018.png

 

Hope it helps.

m

ECG line chart is the most important visualization in your life.
Jack5
Contributor
Contributor
Author

Thank you @mato32188 . It worked