Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Automatic scale for bar chart with several expressions

Hi,

I am trying to do a gant-like chart.

My data are like this :

PROJECTPROJECT_TYPE
START_DATE_TYPE_1END_DATE_TYPE_1START_DATE_TYPE_2END_DATE_TYPE_2

A

101/01/201201/02/2012
A2

01/03/201201/04/2012
B101/03/201215/05/2012

B2

18/02/201210/03/2012












If I try to do a bar chart :

dimension PROJET&PROJECT_TYPE

expression sum( if( PROJECT_TYPE = 1, END_DATE_TYPE_1 - START_DATE_TYPE_1 ))

with an offset sum( if( PROJECT_TYPE = 1, START_DATE_TYPE_1 ))

unchecking forced0

IT IS OK

Idem if I do the same for TYPE2

BUT if I have 2 expressions (one for type 2 and one for type 1) then the min value of the scale is 01/01/1900 and max value is 01/01/2020

Does someone know why ?

Thanks a lot

I attach a doc.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You didn't format your dates so 01/01/2012 is interpreted as 1 divided by 1 divided by 2012. And thats a very small number. When that small number is interpreted as a date you end up near the start of the calendar, i.e. in 1900. See attached qvw.


talk is cheap, supply exceeds demand

View solution in original post

4 Replies
Gysbert_Wassenaar

You didn't format your dates so 01/01/2012 is interpreted as 1 divided by 1 divided by 2012. And thats a very small number. When that small number is interpreted as a date you end up near the start of the calendar, i.e. in 1900. See attached qvw.


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you very much Gysbert !!

How do you explain that each one of my expression is correctly interpreted, but when both are activated it doen"t work ?

Not applicable
Author

Any idea ?

Because even if you example work, i'm stuck with my real data

Not applicable
Author

OK

I see that in addition to force the date format, you also defined a static min.

If i remove that static min, your chart has the same problem as mine : the scale is OK with 1 expression, and is screwed with 2.

So I guess it is a QV bug.