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

Create straight table in QlikView script

I want to take this:

id.png

and count each respective distinct key, per key in the YearEventKey table, in a separate table... like this straight table output:

key.png

but I want to do it in the script. I need to be able to add this information to another table while the script is run. Is there a way I can get the distinct keys counted like the straight table but without having to export it as excel and re-import it?

1 Solution

Accepted Solutions
joshabbott
Creator III
Creator III

It looks like that table already exists in your script.  Let's pretend it is called Table1:

  Try something like this in your script:

 

Load

  YearEventKey as YearEventKey_Grouping

, count(ID) as CountOfEach
Resident

Table1
GROUP

BY

YearEventKey;

This should create a table in your script with the YearEventKey_Grouping column, then a count column (CountOfEach)

View solution in original post

2 Replies
joshabbott
Creator III
Creator III

It looks like that table already exists in your script.  Let's pretend it is called Table1:

  Try something like this in your script:

 

Load

  YearEventKey as YearEventKey_Grouping

, count(ID) as CountOfEach
Resident

Table1
GROUP

BY

YearEventKey;

This should create a table in your script with the YearEventKey_Grouping column, then a count column (CountOfEach)

Not applicable
Author

Amazing. It Worked perfectly. Thank you very much. For some reason I didn’t think of counting inside the load script. Much Appreciated.