Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
rashi_0920
Contributor
Contributor

Counting all active warnings on a part in a current week

Hi,

I am new to Qlik and still exploring better ways of implementing any requirement. My current requirement is to count all the warnings that were generated on a part on week on week basis for the current cadence month (My cadence month is different from any regular month). This means count for a particular week should not only include the number of warnings generated for the part in the current week but should also include all the warnings which are active from previous weeks in the current cadence month. To show the count I have created a measure for each week as follows: 

Week 1: count({<Weekly_Rank={'1'}, Rank_Num={$(=max(Rank_Num))}>} Part)

 Week2 : count({<Weekly_Rank={'1'},Rank_Num={$(=max(Rank_Num))},IsActiveCurrently={'Y'}>} Part)

                  +

                count({<Weekly_Rank={'2'}, Rank_Num={$(=max(Rank_Num))}>} Part)

.

.

Week 5 : count({<Weekly_Rank={'1'}, Rank_Num={$(=max(Rank_Num))},IsActiveCurrently={'Y'}>} Part) 

count({<Weekly_Rank={'2'}, Rank_Num={$(=max(Rank_Num))},IsActiveCurrently={'Y'}>} Part) 

+

count({<Weekly_Rank={'3'}, Rank_Num={$(=max(Rank_Num))},IsActiveCurrently={'Y'}>} Part) 

+

count({<Weekly_Rank={'4'}, Rank_Num={$(=max(Rank_Num))},IsActiveCurrently={'Y'}>} Part) 

+

count({<Weekly_Rank={'5'}, Rank_Num={$(=max(Rank_Num))}>} Part)

 

The only issue I am facing now is that even if I am in Week 2 of my current cadence month, I am displayed count till week 5. I want to show a particular week's bar only if it's present in my data set i.e week 5 bar should only be shown if I am in Week 5.

 

Any help would be much appreciated.

Labels (5)
1 Reply
qlikerB96
Contributor III
Contributor III

Hi,

 

I am not totally sure what is your purpose. But if your expression is corret and you only want to filter the visible dimensions, I would try to filter them, when I add the Week dimension to the bar chart. 

The Dimension expression should be this: =IF(Week < Week(Today()), Week). Or you can use =< too, depends on your purpose.

*Week - the dimension which contains the week number

*Week(Today()) - returns the number of the todays's week

In this case you will get a bar with a null-values, so you should uncheck the 'Include null values'.

I'll attach a printscreen.

Good luck,

B.