Forum Discussion

spandy34's avatar
spandy34
Responsive Resident
2 years ago
Solved

Continuous Date Table

I have a date table with a MIndex field as outlined below.  I want to be able to plot a line graph that goes from June 2022 to todate based on month.

 

How do I stop all the May , June , July etc for 2022 and 2033 being clumped together .  I sort by MIndex but the MIndex goes back to 1 for January.  Is there a way this can be continuous?

 

@tamerj1 parry2k  Anonymous Greg_Deckler 

 

Thank you

 

Procurement_Delivered_Visit_Date = var _tab = CALENDAR(MINX('Procurement_Main_Data',[DeliveredEntryDateTime]), MAXX ('Procurement_Main_Data',[DeliveredEntryDateTime]))
var _tab1 = ADDCOLUMNS(_tab ,"Week No", QUOTIENT( datediff(minx(_tab, [Date]),[date],day) ,7),
"Year" , QUOTIENT( QUOTIENT( datediff(minx(_tab, [Date]),[date],day),7),52)+1
,"Period No", MOD(QUOTIENT(DATEDIFF(minx(_tab,[Date]),[date],day),28),13)+1,
"CalMonth", FORMAT ( [Date], "mmm" ),
"CalYear", YEAR ( [Date] ),
"MIndex", MONTH ( [Date] ),
"Dateid",FORMAT([Date],"yyyymmdd")
)
return _tab1
 
 

 

  • spandy34 , Create sort column and mark that as the sort column

     

    month year sort = year([Date])*100 + month([Date])

     

    Click on month year and the in the "column tools" uses sort by column and mark month year sort as a sort column

     

    How to Create Sort Column and Solve Related Errors:
    https://www.youtube.com/watch?v=KK1zu4MBb-c

     

     

3 Replies

  • spandy34 , Create sort column and mark that as the sort column

     

    month year sort = year([Date])*100 + month([Date])

     

    Click on month year and the in the "column tools" uses sort by column and mark month year sort as a sort column

     

    How to Create Sort Column and Solve Related Errors:
    https://www.youtube.com/watch?v=KK1zu4MBb-c

     

     

    • spandy34's avatar
      spandy34
      Responsive Resident

      Hi thats created the column great - i have selected the month year sort column then selected as a sort as below but I am still getting the result in the table below.  What am i doing wrong please?

       

       

       

    • spandy34's avatar
      spandy34
      Responsive Resident

      Ive sorted it - I really appreciate your help

       

      THank you