Qlik Community

Qlik DataMarket Discussions

Discussion Board for collaboration regarding Qlik DataMarket.

12r01a0517
New Contributor II

Join and Resident Load

Hello Everyone,

I have a requirement where i need to get the count of order lines for one order.

For this i have wrote a query like below, when i execute this i am getting the Invalid Expression general script error.

Order:

Left Join(OrderTable)

Load OrderLineField,

         COUNT( DISTINCT OrderLineField) as Orders_Count

         RESIDENT OrderLineTable

        Group By Order_ID;

Can anyone of you please help me to resolve this:

4 Replies
nadeemsmarty
Valued Contributor

Re: Join and Resident Load

Because you are using the wrong field in the group by statement

Highlighted
nadeemsmarty
Valued Contributor

Re: Join and Resident Load

It should have been

Left Join(OrderTable)

Load Order_ID,

         COUNT( DISTINCT OrderLineField) as Orders_Count

         RESIDENT OrderLineTable

        Group By Order_ID;

Not applicable

Re: Join and Resident Load

Hi,

try this

Order:

LOAD * INLINE [

    OrderID, OrderLine

    PO1001, 1

    PO1001, 2

    PO1002, 1

    PO1002, 2

    PO1002, 3

];

Left Join(Order)

Load

  OrderID,

  Count(DISTINCT OrderLine) as #Line

Resident Order

Group by OrderID

rgds,

Daniel

12r01a0517
New Contributor II

Re: Join and Resident Load

Hi all,

It is working thanks for correcting me