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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
EJeronimo
Contributor III
Contributor III

Agregation Bar chart by period

I'd like to create a bar chart by period as a example below using the agregation function, but is not working as i need.

I need to count the "ITEM", "DATE" and the "MaxString(STATUS)" OR "ITEM", "Max(DATE)" and "STATUS" 

in this example below the correct information for March should be 02 Status "STEP 5":

CPPRAA163762 -  08/Mar/2023 - STEP 5

CPPRAA164308 - 31/Mar/2023 - STEP5

 

EJeronimo_0-1691516464581.png

 

Labels (1)
1 Solution

Accepted Solutions
EJeronimo
Contributor III
Contributor III
Author

Hi @BrunPierre 

unfortunally doenst work as should be when grouped by period, only work fine with "DATE" with a format ("dd/mmm/yyyy") but the users decide / Select what format in X axle want to work.

- If the user want to see the X axle by month, the dimension is:  Date#(Date(DATE,'MMM/YYYY'),'MMM/YYYY')

- If the user want to see the X axle by week, the dimension is:  WeekName(DATE)

- If the user want to see the X axle by Year, the dimension is: Date#(Date(DAT_DATE,'YYYY'),'YYYY')

in this case the chart doesn't work, the chart only see the Max date

EJeronimo_0-1691584676459.png

 

View solution in original post

4 Replies
BrunPierre
Partner - Master II
Partner - Master II

Like this I presume.

=Count(DISTINCT Aggr(If(MaxString(TOTAL <ITEM> DATE) = DATE, ITEM), ITEM, DATE, STATUS))

EJeronimo
Contributor III
Contributor III
Author

Hi @BrunPierre ,

It's working fine in March period but disapear the Feb bar period.

The qty should be:

Feb/2023: 2 (STEP 1 - 4)

Mar/2023: 2 (STEP 5) - correct your sugestion

BrunPierre
Partner - Master II
Partner - Master II

=Count(DISTINCT Aggr(If(MaxString(TOTAL <ITEM, [Month/Year]> DATE) = DATE, ITEM), ITEM, DATE, STATUS, [Month/Year]))

EJeronimo
Contributor III
Contributor III
Author

Hi @BrunPierre 

unfortunally doenst work as should be when grouped by period, only work fine with "DATE" with a format ("dd/mmm/yyyy") but the users decide / Select what format in X axle want to work.

- If the user want to see the X axle by month, the dimension is:  Date#(Date(DATE,'MMM/YYYY'),'MMM/YYYY')

- If the user want to see the X axle by week, the dimension is:  WeekName(DATE)

- If the user want to see the X axle by Year, the dimension is: Date#(Date(DAT_DATE,'YYYY'),'YYYY')

in this case the chart doesn't work, the chart only see the Max date

EJeronimo_0-1691584676459.png