Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I have the the script
Invoice: number of rows 413, InvoiceId has distinct values from 1 to 413
LOAD
CustomerId,
InvoiceDate as Date,
InvoiceId;
SQL SELECT *
FROM Invoice;
InvoiceLine: number of rows 2241, InvoiceId has repeted values
LOAD InvoiceId,
InvoiceLineId,
Quantity,
TrackId,
UnitPrice;
SQL SELECT *
FROM InvoiceLine;
I created a text object wjth expression: =count(InvoiceId) and I had the result 2241. (I understand why, no problem).
Under InvoiceLine table I inserted the script:
Concatenate (Invoice)
LOAD CustomerId,
SupportRepId,
Budget,
makedate(Year,1,1) as Date
FROM ....
And then the result was 413. I don't understand, I expected was 2241.
Then I have loaded InvoiceLine before Invoice and the the result was 2241.
Why this behavior?
Someone can explain why?
Thanks in advance.
Don't use count() on a key field. Qlikview won't know which table should be used to count the values. If you want to know the distinct number of InvoiceID values then use count(distinct InvoiceID). That will always return the same result.
Ok thanks!