Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
kunkumnaveen
Specialist
Specialist

how to display quarter on axis

Hello All,

my requirement is i need to display current , previous score and there respective quarters for all the location..

to achieve this i took bar chart

                              dimension: location,quarter

                            expression:current score: FirstSortedValue(OVERALL_SCR,-ADATE)

                                              previous score: FirstSortedValue(OVERALL_SCR,-ADATE,2)

              by writing this i am getting messed up bar chart (slide 1)

               

later i replace the expression:

            current score:Sum({<ADATE={"$(=max(ADATE))"},YEAR=,QUATERS=,name1=,ENSTEHDAT=>}OVERALL_SCR)

            pervious score:Sum({<ADATE={"$(=max(ADATE),2)"},YEAR=,QUATERS=,name1=,ENSTEHDAT=>}OVERALL_SCR)

i got some wired out put (slide 2)...


last time by writing the second expression(sum()) and adding two dimension it worked out perfectly ,but only thing was see the location fields last time it was only a single field but now it is a common key field,is that because the sum() expression is not work?


please help in writhing down proper expression...

please find work file attachment


1 Reply
Gysbert_Wassenaar

Try using an AsOf table:

AuditScore:

LOAD 

     WERKS  as LOCATION,

     date(ADATE,'MM/DD/YYYY') AS ADATE,

     Dual(QUARTER,QuarterStart(ADATE)) as QUARTER,

     OVERALL_SCR    

FROM

  (qvd)

  ;

AsOf:

LOAD DISTINCT

  QUARTER as ReportQuarter,

  QUARTER as QUARTER,

  'Current' as Period

RESIDENT

  AuditScore

  ;

CONCATENATE (AsOf)

LOAD

  QUARTER as ReportQuarter,

  Dual('Q' and Ceil(Month(QuarterStart(QUARTER,-1))/3), QuarterStart(QUARTER,-1)) as QUARTER,

  'Previous' as Period

RESIDENT

  AuditScore

  ;

Then use ReportQuarter as dimension instead of QUARTER. And change your expressions to use Period to select the right quarter

current: sum({<Period={'Current'}>}Amount)

previous: sum({<Period={'Previous'}>}Amount)


talk is cheap, supply exceeds demand