Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
ankit777
Specialist
Specialist

Count total matches

Hi All

I have data like this

Match ID     COMP1     COMP2

1               Team1          Team2

2               Team2          Team3

3               Team3          Team1

...

I want to show in a graph, How many matches each team has played.

How can I achieve this.

Thanks

6 Replies
Anonymous
Not applicable

load a flag in the script:

LOAD if(COMP1=COMP2,1) as FLAG...

then

do a count(FLAG) in the chart

ankit777
Specialist
Specialist
Author

Hi

How can COMP1 be equal to COMP2?

There will be 2 different teams playing a match

agni_gold
Specialist III
Specialist III

A:

Load Match,Comp1  AS Company;

LOAD * INLINE [

    Match, Comp1

    1, Team1

    2, Team2

    3, Team3

];

Concatenate

Load Match,Comp2  AS Company;

LOAD * INLINE [

    Match, Comp2

    1, Team2

    2, Team3

    3, Team1

];

Anonymous
Not applicable

LOAD COMP1 as COMP resident Yourtable;

concatenate

LOAD COMP2 as COMP resident Yourtable;

then count(COMP) in the chart / script  and COMP as dimension

sunny_talwar

May be using a link table approach

Table:

LOAD * Inline [

Match ID,    COMP1,    COMP2

1,              Team1,          Team2

2,              Team2,          Team3

3,              Team3,          Team1

];

LinkTable:

LOAD [Match ID],

  COMP1 as Team,

  'Comp1' as Flag

Resident Table;

Concatenate(LinkTable)

LOAD [Match ID],

  COMP2 as Team,

  'Comp2' as Flag

Resident Table;

agni_gold
Specialist III
Specialist III

hey Ankit , i think this you want ,

A:

Directory;

CrossTable(Comp, Team)

LOAD Match,

     Comp1,

     Comp2

FROM

[New Microsoft Excel Worksheet.xlsx]

(ooxml, embedded labels, table is Sheet1, filters(

Transpose(),

Transpose()

));