Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

LOAD count

 

Good morning,

 

I try to count the nb of reinsurers per file, knowing that my data is grouped by ref1, ref2 and layer_no.

 

Systems returns "Invalid expression" with the code below. Could you please let me know where is the mistake ?

 

 

temp:
LOAD ref1,
ref2,
layer_no,
clm_rein_dist_no,
...,
...

 

FROM [zzzz] ;

 

 

Table_count:
LOAD
Distinct
*,
count (clm_rein_dist_no) as NbReassureurs
Resident temp
Group by ref1, ref2, layer_no ;
DROP
Table temp;

 

 

For example :

 

   

ref1ref2layer_noclm_rein_dist_no
PR0015632 A 11
PR0015632 A 12
PR0015632 A 13
PR0015632 A 14
PR0015632 A 21
PR0015632 A 22
PR0015632 B 11
PR0015632 B 12
PR0015632 B 13
PR0015632 B 14
PR0015632 B 21
PR0015632 B 22

 

I expect the below result :

   

   

ref1ref2layer_noNbReassureurs
PR0015632 A 14
PR0015632 B22
PR0015632 A 14
PR0015632 B22

Thank you in advance for your help

 

1 Solution

Accepted Solutions
sunny_talwar

Try this

temp:
LOAD ref1,
ref2,
layer_no,
clm_rein_dist_no,
...,
...

FROM [zzzz] ;

Table_count:
LOAD ref1,

    ref2,

    layer_no,
    count (clm_rein_dist_no) as NbReassureurs
Resident temp
Group by ref1, ref2, layer_no ;
DROP Table temp;

View solution in original post

2 Replies
sunny_talwar

Try this

temp:
LOAD ref1,
ref2,
layer_no,
clm_rein_dist_no,
...,
...

FROM [zzzz] ;

Table_count:
LOAD ref1,

    ref2,

    layer_no,
    count (clm_rein_dist_no) as NbReassureurs
Resident temp
Group by ref1, ref2, layer_no ;
DROP Table temp;

Not applicable
Author

This works fine, thank you