Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to write expresion

sunindiagwassenaarjagan

HI All,Looks a bit simple but not working out for me

let say like this

location   date                     score1         score2    score3       finalscore                

czl          01/20/2105               10               10         10                10

czl          02/20/2105               20               20         20                20

czl          03/20/2105               50                50        50                50


first requirement is simple  just show max finalscore with location:

in a straight table i choose location as dimension

                                    expression :max(finalscore)

result:@

           location              max(finalscore)

             czl                         50      ....... which is fine

second requirement :if end user want to see the max(finalscore) sub values i mean score1 score2 score3 on clicking on location which is in my case

max(finalscore)     score1   score2     score3

50                            10       10              10      

to achieve this i wrote crosstable function in  script  like

crosstable(score,values,3)

load location,

       date,

       finalscore,

       score1,

       score2,

       score3

FROM

(qvd);

  in my sheet they will be two charts tables      1.result chart(on clicking  any location which associated with max(finalscore))

                                                                    2.straight  chart with score1,score2,score3 values of max(finalscore)

second chart:

dimension:location,score(which i got by applying cross function)


    location        score        expression has to be written to fetch only those values

     czl               score1          50

      czl               score2          50

      czl               score3          50


finally i need help what expression should i need to write to achieve this please

thanks

naveen

2 Replies
kunkumnaveen
Specialist
Specialist
Author

Hello

sorry the actual values r

max(finalscore)     score1   score2     score3

50                            50      50             50     

thanks

naveen

Gysbert_Wassenaar

It might actually be easier without the crosstable:

  • max(finalscore)
  • firstsortedvalue(score1, -finalescore)
  • firstsortedvalue(score2, -finalescore)
  • firstsortedvalue(score3, -finalescore)


if you use the crosstable function it becomes:

  • max(finalscore)
  • firstsortedvalue({<score={'score1'}>}values, -finalescore)
  • firstsortedvalue({<score={'score2'}>}values, -finalescore)
  • firstsortedvalue({<score={'score3'}>}values, -finalescore)

talk is cheap, supply exceeds demand