Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

patriciousa
Contributor

Bart chart not showing bar after using in sheet filter that equals 0

Hi community.

I have a bar chart with the following Dimension with the calendar that shows each day of the week:

Calendar:

DECLARE FIELD DEFINITION TAGGED '$date'

Parameters

first_month_of_year = 1

Fields

Weekday($1) as Weekday Tagged '$weekday',

DayNumberOfYear($1, first_month_of_year) as DayNumberOfYear Tagged ('$numeric');

DERIVE FIELDS FROM FIELDS "Fecha Registro" USING Calendar;

and the Measure:

Sum(Hours)

I have a table next to the bar chart to be able to filter by each person how much hours have worked each day of the week (From Monday to Friday).

When using the filter, you get that not everyone have worked everyday, so the bar chart starts moving.

The problem is that I need the X axis (Day of the week) to not dissapear if that day is equal to 0.

I tried Show Nulls and Zero Values but it doesn't do the job.

Thank you in advance.

Regards.

1 Solution

Accepted Solutions
MVP
MVP

Re: Bart chart not showing bar after using in sheet filter that equals 0

You can include the Weekday filter in the set analysis, maybe like

Sum({<WeekDay = {">=0<=4"}>}Value) + sum({1<WeekDay = {">=0<=4"}>}0)

The second sum() is adding zero to all lines, hence doesn't change the result of your expression.

The interesting part is the set expression used ({1} in the original answer). The set expression should exclude all selections that limit the possible WeekDay values, the most simple way is to use set identifier 1 (all records in the data model, no user selections). QS will only show dimension values that are possible in the scope of the aggregations used in your expressions.

4 Replies
MVP
MVP

Re: Bart chart not showing bar after using in sheet filter that equals 0

Try to change your expression to

=Sum(Hours) + Sum({1} 0)

patriciousa
Contributor

Re: Bart chart not showing bar after using in sheet filter that equals 0

You are great swuehl!, Thank you very much!

One more little thing. Now I'm getting all days but I want to delete from the bart chart, Saturday and Sunday. How do I do it??

And could you explain the syntax Sum({1} 0)? I want to understand what is doing.

Thank you again.

MVP
MVP

Re: Bart chart not showing bar after using in sheet filter that equals 0

You can include the Weekday filter in the set analysis, maybe like

Sum({<WeekDay = {">=0<=4"}>}Value) + sum({1<WeekDay = {">=0<=4"}>}0)

The second sum() is adding zero to all lines, hence doesn't change the result of your expression.

The interesting part is the set expression used ({1} in the original answer). The set expression should exclude all selections that limit the possible WeekDay values, the most simple way is to use set identifier 1 (all records in the data model, no user selections). QS will only show dimension values that are possible in the scope of the aggregations used in your expressions.

patriciousa
Contributor

Re: Bart chart not showing bar after using in sheet filter that equals 0

Thank you very much for your help swuehl.