Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
vbravomo
Contributor III
Contributor III

Bar graph by month and half hour

Hello everyone,

I have a big problem. I've created temporary dimensions like "month" and "half-hour" and the problem is that I need to see all the half-hours, even if the metric is 0, but not all the months (only if it's more than zero).

So I decided to put the bellow formula:

If('$(vTempGrafico)'='HalfHour' ,count(distinct G1)+0*count({1}G1),count(distinct G1))

But it doesn't fix at all, because the {1} skips the selection of month or half-hour, so with it, I keep watching all dimensions in month and half-hour. 

I've tried putting the metric to null when the month is selected, but in the graph, it keeps visualising. They only disappear when I uncheck "include zero values", but if I do it it means that the half hours with metric = 0 will disappear too.

Any idea please? 

Labels (2)
2 Replies
Gysbert_Wassenaar

I think you'll have better luck if you create a dimension table with the halfhour field and fill it with every possible halfhour. That way you can use the halfhour field as dimension in your bar graph and make sure it shows all values.


talk is cheap, supply exceeds demand
vbravomo
Contributor III
Contributor III
Author

Thanks for the suggestion, but I have more than two temporary dimensions and it's necessary to work with the variables. Is it possible, in any way, that I could set null values in the dimension? Like if metric > 0 and variable = Month or if the variable  = Half-Hour shows the dimension, else null. 

I tried with if, but the result is invalid dimension and I'm not sure how to do it with only. 

Any suggestion? 

Thank you