Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculate Number of Invoice and Item Repetition

Hi all

I'm new to Qlikview.

I have a table like this:

Item CodeInvoice No.
A111
B111
D112
A113
C114
C114
C114

Now I want codes for:

1- Number of issued invoice: (Answer is 4)

2- Item repetition

Answer:

Item CodeRepetition
A2
B1
C3
D1

Please help me.

Thank you in advance.

Regards,

Ashkan

1 Solution

Accepted Solutions
Not applicable
Author

try this

tab1:

LOAD * INLINE [

    Item Code, Invoice No.

    A, 111

    B, 111

    D, 112

    A, 113

    C, 114

    C, 114

    C, 11

];

result:

load [Item Code] as Item,

    count([Invoice No.]) as Reception

    Resident tab1

    Group by [Item Code];

then output like this

ItemReception
A2
B1
C3
D1

View solution in original post

5 Replies
Not applicable
Author

1. count(distinct [Invoice No.])

2. I d'ont understand what you call repetition

Not applicable
Author

try this

tab1:

LOAD * INLINE [

    Item Code, Invoice No.

    A, 111

    B, 111

    D, 112

    A, 113

    C, 114

    C, 114

    C, 11

];

result:

load [Item Code] as Item,

    count([Invoice No.]) as Reception

    Resident tab1

    Group by [Item Code];

then output like this

ItemReception
A2
B1
C3
D1
Sokkorn
Master
Master

Hi Ashkan,

Try below script:

[Data]:

LOAD * INLINE [

Item Code,    Invoice No.

A,    111

B,    111

D,    112

A,    113

C,    114

C,    114

C,    114];

[Data2]:

LOAD

    [Item Code],

    [Invoice No],

    Count([Item Code])    AS [Repetition]

Resident [Data] Group By [Item Code],[Invoice No];

Drop Table [Data];

It should work.

Regards,

Sokkorn

Not applicable
Author

Hi yadurand

Thanks for yor reply.

The second table was incorrect. I've update it now.

I want a table to calculate the repetition of item code.

Not applicable
Author

OK then the 2. is :

count([Invoice No.]) as expression in a chart where item code is the dimension