Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Help on Linking & grouping Time in tables

I'm new to Qlik Sense Desktop, so sorry if this has been asked / answered before. Struggling to find help on this topic online and in the books I have purchased.

I have data I am trying to analyse - Sales of Food & Drink and Sales of Admissions. I've imported tables from a few databases and linked up the dates in all the tables which seems to work.

I now want to link the time field (TransTime) in the Admiss and TransItems Tables. I want to be able to create a filter where I can select a particular time period (ideally grouped in 30min intervals if its possibe) so that I can see the Admission sales data and the Food & Drink sales data for transactions that occurred in the selected time groups.

I'm really struggling as the times are listed individually (not sure how I can group them into 30min intervals within a filter) and most of the times are showing as 00:00:00 which also seems to be when the majority of the sales data is connected to.

To create the times I had to use LEFT and RIGHT string functions to get the figures from other data in the table so may have made a mistake.

I've attached the model the sheet on the app where I want to show the data is called Time Graphs.

Thanks for reading my query.

5 Replies
brunobertels
Valued Contributor

Re: Help on Linking & grouping Time in tables

Hi Simon

use this as dimension in your graph

time(class(TransTime,MakeTime(0,30)))

you will have this :

regards

Not applicable

Re: Help on Linking & grouping Time in tables

Hi Bruno,

Thanks for your reply - I will give it a try.

Is there a way I can create a filter for the time periods so all other graphs / data will show results for specific time periods I select?

Thanks again

brunobertels
Valued Contributor

Re: Help on Linking & grouping Time in tables

Hi

Yes it is

open a filter panel object and add your mesure

time(class(TransTime,MakeTime(0,30)))

you can also add a new dimension in your script

here in your script : (clic on the unlock script button before)

[TransItems]:

LOAD

    [ItemNo] AS [PLUS_Code],

    Date([Date] ,'DD/MM/YYYY') AS [Daily Income.DAILYINCOME_Date],

    [Time] AS [TRANSITEMS_IncorrT],

    [Qty] AS [TRANSITEMS_Qty],

    [Val] AS [TRANSITEMS_Val],

    [ECR] AS [TRANSITEMS_ECR],

    Left([Date],10) AS [TransItems.TransItems.DAILYINCOME_Date],

     Time(class(Time(Right([Time],8)),MakeTime(0,30))) as "Half_Hour_Period",

    Time(Right([Time],8)) AS [TransTime];

PS i juste realise that the filter pan as well as the half hour dimension is not going from 9:00:00 to 00:00:00 but is repeat itself.

see below :

Not applicable

Re: Help on Linking & grouping Time in tables

Thanks Bruno,

How would I stop it repeating itself?

brunobertels
Valued Contributor

Re: Help on Linking & grouping Time in tables

Hi Simon

I don't know exactly why it's repeating itself , may be it's due to different Time format in your Time field.

Or maybe due to my mesure to bucket the hour.

You should find another solution sorry

Bruno

Community Browser