Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
its_rajvir
Creator
Creator

Create Bar Chart

Dear Experts,

I need to create a Bar Chart using the below sample data:

Working Day TxnDate  Time Hour  Sales
22-Sep-23 22-Sep-23 4 1000
22-Sep-23 22-Sep-23 5 2000
22-Sep-23 22-Sep-23 6 1562
22-Sep-23 22-Sep-23 7 6452
22-Sep-23 22-Sep-23 8 3245
22-Sep-23 22-Sep-23 9 1334
22-Sep-23 22-Sep-23 10 1324
22-Sep-23 22-Sep-23 11 2435
22-Sep-23 22-Sep-23 12 1324
22-Sep-23 22-Sep-23 13 748
22-Sep-23 22-Sep-23 14 1010
22-Sep-23 22-Sep-23 15 2000
22-Sep-23 22-Sep-23 16 1012
22-Sep-23 22-Sep-23 17 1013
22-Sep-23 22-Sep-23 18 1014
22-Sep-23 22-Sep-23 19 1015
22-Sep-23 22-Sep-23 20 1016
22-Sep-23 22-Sep-23 21 3000
22-Sep-23 22-Sep-23 22 1018
22-Sep-23 22-Sep-23 23 2572
22-Sep-23 22-Sep-23 24 1020
22-Sep-23 23-Sep-23 0 1021
22-Sep-23 23-Sep-23 1 1022
22-Sep-23 23-Sep-23 2 1023

 

The problem i am getting is in sorting because the start of the bar chart should be Time hour 4 and end should be 2 because working day starts from 4 AM  and ends at 2 AM Next day. How to sort based on Working day and TxnDate(Normal date)

2 Replies
Chanty4u
MVP
MVP

Hi

load the data and create below filed

Timestamp(Date(TxnDate, 'DD-MMM-YY') & ' ' & [Time Hour], 'YYYY-MM-DD hh') as Timestamp

 

then create a bar chart with  new timestamp as dimension and measure as sales.  and sort accordingly

fe-c
Contributor III
Contributor III

Hi Chanty4u, 

I don't think that this was the intention of the question because with that solution, the questioner get wrong results when he add a date picker, because the sales of 23-Sep-23 2 AM are sales which should count to 22-Sep-23.

I would solve this in 2 steps: 

1) create a 'master calendar' with dates of Working Day as 'MasterDate' (key)
2) create a new field as combination TxnDate & TimeHour and substract the offset of 4h as 'MasterDate' (key)

Now you can select your MasterDate in your visualizations and get the correct sales.