Skip to main content
Announcements
Join us on Sept. 17 to hear how our new GenAI Assistant empowers data professionals: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
fjdriouich
Contributor
Contributor

Is it possible to do an arithmetic progression by year ?

Hello community,

Can you please help me to have this result

Evolution type Nb Student N-1 Nb Student N/N+1 Nb Student N+1/N+2
D=> C 2 1  
B (constant) 1 1  
A (constant) 1 1  
C=>D 1 1  
A=>C 1 0  
C (constant) 0 2  

 

If I have this data initially ?

  Evaluation year N-1 Evaluation year N Evaluation year N+1 Evaluation year N+2
Student 1 D C C  
Student 2 C D C  
Student 3 B B B  
Student 4 A A A  
Student 5 A C D  
Student 6 D C C  

 

Thank you in advance,

Best regards

Labels (1)
2 Replies
vinieme12
Champion III
Champion III

as below

 

Main:
Load *
,[EvaluationyearN-1]&[EvaluationyearN] as 	[NbStudentN-1]
,[EvaluationyearN]&[EvaluationyearN+1] as 	[NbStudentN/N+1]
,[EvaluationyearN+1]&[EvaluationyearN+2] as 	[NbStudentN+1/N+2]
;
load * inline [
  Student,EvaluationyearN-1,EvaluationyearN,EvaluationyearN+1,EvaluationyearN+2
Student 1,D,C,C, 
Student 2,C,D,C, 
Student 3,B,B,B, 
Student 4,A,A,A, 
Student 5,A,C,D, 
Student 6,D,C,C
];

CrossTable(Compare,Values,1)
Dim:
Load 
Student
,[NbStudentN-1]
,[NbStudentN/N+1]
,[NbStudentN+1/N+2]
Resident Main;

left Join(Dim)
Labels:
Load * inline [
Values,Label
DC,D=>C
BB,B(Constant)
AA,A(Constant)
CD,C=>D
AC,A=>C
CC,C(Constant)
];

exit Script;

 

vinieme12_0-1666938742760.png

 

Dimension:

Label

Measures

=Count({<Compare={'NbStudentN-1'}>}Distinct Student)

Count({<Compare={'NbStudentN/N+1'}>}Distinct Student)

Count({<Compare={'NbStudentN+1/N+2'}>}Distinct Student)

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
fjdriouich
Contributor
Contributor
Author

Hello,

Thank you very much for your response

Actually what I would like to have is an arithmetic propgression with a result like this :

fjdriouich_0-1667469517789.png

And I have all the datats concerning the marks of the student. I would like to have a resultat depending on the number of year i choose

Best regards