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: 
Stefan99
Contributor
Contributor

Bar chart Qlik Sense - Start day 1 hour earlier (dimension and measure)

Hello,

 

I am quite new to Qlik Sense. I have the following bar chart:

 

clipboard_image_0.png

 

I am having the following expressions for dimensions/measures:

dimensions:  =tstamp.autoCalendar.Date 

measure uses the following expression:  =1-((count({<part={'special'},  category {'good'}>} part))/(count(if(match(part, 'special'),part))))

It basically uses the two columns "part" and "category". It calculates then all the special parts which are good.

Now I would like to change the values of the bars so that the day starts and ends 1 hour earlier. e.g. bar 01.10.2019 should represent data from from 11pm (previous day, 30.09.2019) to 01.10.2019, 11pm. 

Does anyone know how this can be realised? 

 

Edit: another questions would be if it is possible to display only the last 7 days?

Thank you!

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

It should be possible but you would need to create a different date column in your script. something like below
e.g. check if time is after 11 pm if so put it as next day
if(hour(timestamp-column-from-data)=23, date(floor(timestamp-column-from-data),'MM-DD-YYYY')+1, date(floor(timestamp-column-from-data),'MM-DD-YYYY')) as NewDateColumn

also i would recommend using script to create a master calendar table, rather than using the auto calendar (gives more flxibility)
e.g.
https://qlikviewcookbook.com/2015/05/better-calendar-scripts/
and in the master calendar add a new Date Field which indicates the condition that you mentioned