Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I am currently trying to use the "count distinct" in my script. However, I face an issue when loading the data. Qlik tells me that I have an "invalid expression". Could you please help me solving my issue?
Thanks,
Marguerite
The script is:
NoConcatenate
[inst_per_course_1]:
Load
[Course],
[CourseIdentifier],
[CourseTypeFamily],
[CustomerType],
[TraineeCode],
Trigram,
count(DISTINCT Trigram) as nb_instructor
resident [MyTable]
group by Course
;
Is it better to used 2 separate tables? (I also have an "invalid expression" issue when loading data.) as:
NoConcatenate
[inst_per_course_1]:
Load
[Course],
[CourseIdentifier],
[CourseTypeFamily],
[CustomerType],
[TraineeCode],
Trigram
resident [MyTable]
;
NoConcatenate
[inst_per_course_2]:
Load *,
count(DISTINCT Trigram) as nb_instructor
resident [inst_per_course_1]
group by [Course]
;
The error is coming because you have not included all the other fields in group by list.
Try this.
The script is:
NoConcatenate
[inst_per_course_1]:
Load
[Course],
[CourseIdentifier],
[CourseTypeFamily],
[CustomerType],
[TraineeCode],
Trigram,
count(DISTINCT Trigram) as nb_instructor
resident [MyTable]
group by [Course],
[CourseIdentifier],
[CourseTypeFamily],
[CustomerType],
[TraineeCode],
Trigram;