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

Date with multiple values

I have a field called 'add_datetime' which is formatted as m/d/yyy hh:mm

I am attempting to create a chart that uses the field 'num_seats' as the expression. However, the problem I am running into is that for 'add_datetime' there can be multiple instances of the same date occurring.

For example, if 50 seats sold on 1/1/2017, as part of 25 transactions, I want to be able to show that 50 seats sold on 1/1/2017 as opposed to all of the instances of seats selling on 1/1/2017.

1 Solution

Accepted Solutions
evansabres
Specialist
Specialist
Author

Was able to find the correct response from a previous thread:

Do the following in load script:

DayStart(add_datetime)               AS          transDATE

Then in a separate table:

Calendar:

LOAD *

,date(monthstart(transDATE),'MMM YYYY') as [Created Month]

,date(yearstart(transDATE),'YYYY') as [Created Year]

;

LOAD date(fieldvalue('transDATE',recno())) as transDATE

AUTOGENERATE fieldvaluecount('transDATE')

View solution in original post

3 Replies
ahaahaaha
Partner - Master
Partner - Master

Hi Evan,

May be add unique field at load source data for every deal?

RecNo() as ID_Deal


Regards,

Andrey

evansabres
Specialist
Specialist
Author

I want the chart to show that on 1/1/2017 there were 50 seats sold, and then on 1/2/2017, 2 seats sold and down the line so that I can have a chart that shows the growth of sales over time. Currently, just leaving the date as is results in a chart that has as many instances of 1/1/2017 as there were transactions. That is what I am trying to avoid

evansabres
Specialist
Specialist
Author

Was able to find the correct response from a previous thread:

Do the following in load script:

DayStart(add_datetime)               AS          transDATE

Then in a separate table:

Calendar:

LOAD *

,date(monthstart(transDATE),'MMM YYYY') as [Created Month]

,date(yearstart(transDATE),'YYYY') as [Created Year]

;

LOAD date(fieldvalue('transDATE',recno())) as transDATE

AUTOGENERATE fieldvaluecount('transDATE')