Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, I've combed through the forums and haven't been able to find a suitable answer for this.
I have created a billing dashboard. For my data visualization, I have created a combo chart.
=Sum({<INVOICEDATE = {">=$(=Date(AddMonths(Max(INVOICEDATE),-24),'YYYY-MM-DD'))<=(=Date(AddMonths(Max(INVOICEDATE),-12),'YYYY-MM-DD'))"}>} INVOICEAMT)
Measure 1 is a bar, Measure 2 is a line so that the audience can easily see the differences between the last and previous years' invoicing amounts.
My issue is that because I have made the Invoice Date a month, the first and last month are adding together, in this example, July 2022 and July 2023. I need to be able to separate them. When I use the month and year, it have the line on top of the bars because the X axis expands to all 26 months.
Below I am attaching what I have created so far in Qlik and then underneath what I have been doing manually in Excel. I am trying to automate this dashboard.
It stands to note that I'm just an end user and am not able to load scripts or create master calendars.
TIA!
Hi,
You certainly need to use something more detailed than just a Month, if you want to differentiate this July and last year's July... I'd use something like this for the Dimension (using the original InvoiceDate):
date(MonthStart(InvoiceDate), 'MMM')
This way, your field will be a dual field with the Month Start date as the numeric part and Month name as the text. July will appear twice, because the corresponding numbers will be different.
To learn more advanced development techniques, check out the agenda of the Masters Summit for Qlik - coming soon to Orlando and to Dublin!
That gave unexpected results and now only displays 12 months. I did go and adjust my expression for the previous 13 months (the green line) because I found that it was bringing in too many months. It is now
=Sum({<INVOICE_DT = {">=$(=Date(AddMonths(Max(INVOICE_DT),-24),'YYYY-MM-DD'))<=$(=Date(AddMonths(Max(INVOICE_DT),-12),'YYYY-MM-DD'))"}>} BILLING_AMT)
I validated it with a test table.
Any thoughts on how to fix?
Hmm, it looks like the chart combines the months based on their names, despite the date numbers being different - that used to be different in the past, AFAIK...
You need to find a way of differentiating the names for months 1 and 13. If I had to do it, I'd probably add a field in the Master Calendar table and assign the adjusted Month name, based on dates. In your example, the current July would be called "Jul", and the previous July would be called "Last Jul", for instance.