Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
benrickard
Contributor II
Contributor II

Count transactions by day

Hi there,

I have visualisations that show the number of quotes done on a quarterly, monthly and weekly basis (and other time periods), but I can't seem to work out how to show them on a daily basis. The script of our autoCalendar is below, which I am guessing is the place to put something so we can do a chart of quotes per day. Can someone please help me with how to set this up?

Thanks!

Ben

 

[autoCalendar]:
DECLARE FIELD DEFINITION Tagged ('$date')
FIELDS
Dual(Year($1), YearStart($1)) AS [Year] Tagged ('$axis', '$year'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),Num(Ceil(NUM(Month($1))/3),00)) AS [Quarter] Tagged ('$quarter', '$cyclic'),
Dual(Year($1)&'-Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [YearQuarter] Tagged ('$yearquarter', '$qualified'),
Dual('Q'&Num(Ceil(Num(Month($1))/3)),QuarterStart($1)) AS [_YearQuarter] Tagged ('$yearquarter', '$hidden', '$simplified'),
Month($1) AS [Month] Tagged ('$month', '$cyclic'),
MonthName($1) AS [RollingMonth],
Dual(Year($1)&'-'&Month($1), monthstart($1)) AS [YearMonth] Tagged ('$axis', '$yearmonth', '$qualified'),
Dual(Month($1), monthstart($1)) AS [_YearMonth] Tagged ('$axis', '$yearmonth', '$simplified', '$hidden'),
Dual('W'&Num(Week($1),00), Num(Week($1),00)) AS [Week] Tagged ('$weeknumber', '$cyclic'),
Date(Floor($1)) AS [Date] Tagged ('$axis', '$date', '$qualified'),
Date(Floor($1), 'D') AS [_Date] Tagged ('$axis', '$date', '$hidden', '$simplified'),
If(Year($1) = Year(Today()) and Date(Floor($1)) <= Date(Floor(Today())), 'Current',
If(Year($1) = Year(Today())-1 and Date(Floor($1)) <= AddYears( Date(Floor(Today())) , -1), 'Previous'
)) as [YTD] Tagged ('$axis', '$ytd', '$qualified'),
If(Date(Floor($1)) > AddYears(Date(Floor(Today())),-1) and Date(Floor($1)) <= Date(Floor(Today())), 'Current',
If(Date(Floor($1)) > AddYears(Date(Floor(Today())),-2) and Date(Floor($1)) <= AddYears( Date(Floor(Today())) , -1), 'Previous'
)) as [Rolling 12 Months] Tagged ('$axis', '$rolling12mth', '$qualified')
;

DERIVE FIELDS FROM FIELDS [policy.timestamp], [dateExported], [startDate], [endDate], [coverStartDate], [acceptedDate], [policy_version.timestamp],
[contact.timestamp], [broker.timestamp], [quote.submitDate], [quote.timestamp], [apply.submitDate], [paymentDateTime], [apply.timestamp], [runoffDate],
[dateWorkCommences], [dateWorkCompleted], [version.submitDate] , [CalendarDate]
USING [autoCalendar] ;

Labels (2)
3 Replies
Lisa_P
Employee
Employee

Just use your date as dimension to aggregate by each day.

benrickard
Contributor II
Contributor II
Author

Hi there, 

Thanks for your reply. I have put the date as a dimension, but then I just get an x-axis of dates, including multiples of the same date, with everyone showing just one transaction. It's not aggregating multiple quotes into a single date when I do it that way. Am I using the wrong date field for the dimension?

benrickard
Contributor II
Contributor II
Author

I found the right field to use for the dimension and it's working now. Thanks!