Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Overall sales based on timestamp

Hi Viewers,

Good morning!

I need a clarification,

Sum({<year={2015},month={'May'},day={'Sun'}>}sales)

But how do we analyse total sales based on timestamp

Suppose we have timestamp 6:00pm for Sunday

Pls help me on this.

1 Reply
swuehl
MVP
MVP

You can create fields for hour, minute, second from a timestamp field just like you can create day, month, week, year, etc. from a date:

Set TimestampFormat = 'MM/DD/YYYY hh:mm TT'; // Adjust to your timestamp format code!

LOAD

     TimeStampField,

     Hour(TimeStampField) AS Hour, // will return value between 0 and 23

     Minute(TimeStampField) AS Minute, // will return value between 0 and 59

     WeekDay(TimeStampField) as WeekDay,

....

FROM ....;

Then in your set expression:

=Sum({<Hour = {18}, WeekDay = {'Sun'} >} sales)