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

Aggregating sales by date

I am trying create a bar graph to aggregate sales data based on the date of the transactions (i.e. my date format is dd/mm/yyyy). I would like to view this data by different frequencies, i.e. aggregated on a month basis for the range of the data. What I have now sales showing for each individual date. I have tried using the AGGR , Group By functions but to no avail. Please help

7 Replies
tresesco
MVP
MVP

Create a Month field in the script like:

Load

          DateField,

          Month(DateField) as Month

nad then use this Month field as dimension in the chart, and expression as you want.

Not applicable
Author

Can you provide some sample data ??

Not applicable
Author

Thank you!

What if I need it by month and year as I have data from different years?

Not applicable
Author

In that case u can use this Script

Load

          DateField,

          Month(DateField) & '/' & Year(DateField) as Month/Year

and u can use "Month/Year" as Dimesion in chart

Not applicable
Author

or you use

Load

     DataField,

     Month(DateField) as Month,

     year(DateField) as Year

you can use Month and Year now in a list box and it will calculate the data always for the selected year and month.

regards,

MT

Not applicable
Author

Thanks! Seems like this should be something intuitive in the charting itself instead of having to code. For example you can do this easily in excel by using the group by function. Thank you for your help

tresesco
MVP
MVP

For that, you should generate field like:

Load

          MonthName(DateName) as Month