Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how to show data for ytd and current month

I have a gauge chart that shows my %SLA for the current time period, in this case from 1/1/2013 to present day.  I'd like to create a text field down below this chart that shows the %SLA for the current month to date.  Has any one done this?

QLK.jpg

1 Solution

Accepted Solutions
krishnacbe
Partner - Specialist III
Partner - Specialist III

Here you go. Please validate the data.

below is the expression

=num((sum({<CRCaseYear={"2016"}, CRCaseMonth={"Jun"}>}count_LIVESLO_2)+sum({<CRCaseYear={"2016"}, CRCaseMonth={"Jun"}>}count_ELECSLO_2))
/(
sum({<CRCaseYear={"2016"}, CRCaseMonth={"Jun"}>}count_LIVE2)+sum({<CRCaseYear={"2016"}, CRCaseMonth={"Jun"}>}count_ELEC2))
,'#,##0.0%')

View solution in original post

27 Replies
krishnacbe
Partner - Specialist III
Partner - Specialist III

add year and month operators in your expression to get this.

share the expression you used for SLA calculation, will try to help you to build for current month

Not applicable
Author

Here is the SLA Calculation:

=num((sum(count_LIVESLO_2)+sum(count_ELECSLO_2))/(sum(count_LIVE2)+sum(count_ELEC2)),'#,##0.0%')

krishnacbe
Partner - Specialist III
Partner - Specialist III

Please use below expression.

Date is your Date column. you can replace the hard coded values with variables too for getting the current year and month

=num((sum({year(Date)={'2016'},month(Date)={'Jun'}}count_LIVESLO_2)+sum(({year(Date)={'2016'},month(Date)={'Jun'}}count_ELECSLO_2))/(sum(({year(Date)={'2016'},month(Date)={'Jun'}}count_LIVE2)+sum(({year(Date)={'2016'},month(Date)={'Jun'}}count_ELEC2)),'#,##0.0%')

Not applicable
Author

Excellent!  What if I want to always show the most current month?

krishnacbe
Partner - Specialist III
Partner - Specialist III

You need to create a variable as below

vLatestMonth=max({<Year={$(vLatestYear)}>} Month(Date))

Not applicable
Author

Sorry, but this doesn't seem to be working...I am running into errors when I get to 'month' where it doesn't recognize it:

=num((sum({year(ROW_ADDED_DTTM)={'2016'},month(ROW_ADDED_DTTM)={'Jun'}}count_LIVESLO_2)+sum(({year(ROW_ADDED_DTTM)={'2016'},month(ROW_ADDED_DTTM)={'Jun'}}count_ELECSLO_2))/(sum(({year(ROW_ADDED_DTTM)={'2016'},month(ROW_ADDED_DTTM)={'Jun'}}count_LIVE2)+sum(({year(ROW_ADDED_DTTM)={'2016'},month(ROW_ADDED_DTTM)={'Jun'}}count_ELEC2)),'#,##0.0%')

krishnacbe
Partner - Specialist III
Partner - Specialist III

Try to put this expression in one text box month(ROW_ADDED_DTTM). if it is giving as integer then you need to compare the integer value.

Not applicable
Author

That's interesting, there is no result when I do this, even though it is defined as a date in my script.

krishnacbe
Partner - Specialist III
Partner - Specialist III

Sorry Please give that expression in List box to view the values.

Or select a date in field ROW_ADDED_DTTM. then text box will display the data.