Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Having problems with calculated dimensions

Hello,

I'm trying to create a bar chart that will show the number of invoices per the frequency of days between order and delivery.

E.g. if the order was placed on the 1/1/2010 and was delivered on the 4/1/2010 then the number of days between order and delivery is = 3

What I want my barchart to show is the frequency per days between order and delivery.

|
| x (how many invoices)
| x
| x x
| x x x
| x x x
| x__x__x______________

1 2 3 (days between order and invoice

At the moment my dimension is:

=Aggr(Sum(Invoicedate-Orderdate))

but this is not working (error in dimension)

My expression is:

Count (DISTINCT InvoiceNo)

It seems that QV want's me to add something here

=Aggr(Sum(Invoicedate-Orderdate),MORE CODE IS NEEDED HERE)

but I do not have any ideas.

Anyone that has any ideas?

br

Martin

2 Replies
johnw
Champion III
Champion III

Are Invoicedate and Orderdate both on the same table?

I would just calculate a new field, Invoicedate-Orderdate as DaysToInvoice, and use it as the dimension.

If you really want to calculate the duration on the fly in the chart, then I think your calculated dimension would simply be Invoicedate-Orderdate, no aggr(), no sum(), nothing complicated.

Not applicable
Author

Aggr is used to summarize by a dimension : Aggr( sum( ) , dimension)

In your example, i suspect you don't need aggr. Try just Invoicedate-Orderdate for your dimension.

JJJ