Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all
I'm new to Qlikview.
I have a table like this:
Item Code | Invoice No. |
---|---|
A | 111 |
B | 111 |
D | 112 |
A | 113 |
C | 114 |
C | 114 |
C | 114 |
Now I want codes for:
1- Number of issued invoice: (Answer is 4)
2- Item repetition
Answer:
Item Code | Repetition |
---|---|
A | 2 |
B | 1 |
C | 3 |
D | 1 |
Please help me.
Thank you in advance.
Regards,
Ashkan
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
Item | Reception |
A | 2 |
B | 1 |
C | 3 |
D | 1 |
1. count(distinct [Invoice No.])
2. I d'ont understand what you call repetition
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
Item | Reception |
A | 2 |
B | 1 |
C | 3 |
D | 1 |
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
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.
OK then the 2. is :
count([Invoice No.]) as expression in a chart where item code is the dimension