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

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
tracycrown
Creator III
Creator III

Grouping using class

Dear all

I have problem to get the correct Grouping using Class in following orders:

   

SubjectGrouping201220132014
English61-70211
English71-8013
English81-901 2
English91-100

1

Thank you

Tracy

1 Solution

Accepted Solutions
Digvijay_Singh

Attaching doc here.

View solution in original post

5 Replies
tracycrown
Creator III
Creator III
Author

Sorry, attached the wrong file. please use Test-2.qvw attached below

Digvijay_Singh

Don't have access to qvw as having PE edition but your main issue is getting the start from 61 or something else - see if below output works for you - '60 - 70' means  60 <=marks <70, so in reality it counts between 60-69, 70 is counted in 70-80.

marks.PNG

Digvijay_Singh

Attaching doc here.

tracycrown
Creator III
Creator III
Author

Dear Digvijay

Thanks for your quick response.

Instead of specify the condition in expression, can you advise how to write a script ?

Following script was presented in the attached file but not working, please help.

CrossTable(Year, Data, 4)
LOAD
Dual(SubField(Class(Subject,10,'',1),' <= < ',1)&' - '&(SubField(Class(Subject,10,'',1),' <= < ',2)-1), Class(Subject,10,'',1)) as [Grouping],
*
FROM
[Exam Results.xlsx]
(
ooxml, embedded labels, table is [Exam Results]);

Thank you

Tracy

Digvijay_Singh

See attached -

Table:

CrossTable(Year, Marks, 3)

LOAD

  Seq,

    Name,

    Subject,

    [2012],

    [2013],

    [2014]

FROM

[Exam Results.xlsx]

(ooxml, embedded labels, table is [Exam Results]);

Final:

Load *,Replace(Class(Marks,10),'<= x <','-') as Grouping Resident Table;

Drop table Table;