Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Qlik Sense question: I've searched several forums and spent hours trying to figure this out but I'm stuck. I have a bar chart that I want to show the last 28 days of 1 data point only. I've tried the following and they are not working. Qlik says "OK" to the formula but the chart is still showing more than 28 days. Any other thoughts? I'm not familiar with scripts to trying to do this using set analysis. The Excel file is simple - Column A is Date, Column B is Instock %. Thoughts?
=Date(today()-28, 'MM-DD-YYYY') |
=If(Date((today()-28 and Date(today()))), Date,) |
=IF((Date >(today() AND Date(today()-28 ))), Date,'') |
Michele,
I tried that and received the following error:
I already have date as a dimension. Below is the error I received on the expression:
This is close to what I'm looking for; however, I want to show the dates from oldest to newest. When I sort descending, it puts the newest date first. I'm guessing there's not a way to put a max on the dates but still sort where the oldest date is listed first?
I think not directly, but you can first sort the data in the expression using order by function and then do my previous suggested solution.
hi @RyanP
Sorry, i made a mistake in the formula
sum({<Date={">=$(=date(today()-28))<=$(=today())"} >}Sales)
Remember to use this formula as expression
and as dimension only the date field.
it should shows as dimension the las 28 days whiout using an IF in the dimension.
Best,
Hi Rafael. Qlik said the formula was "OK" but the visualization still says "Invalid dimension." Any other thoughts as to why?
Hi @RyanP
are you using my expression as dimension?
If not, please paste here what you have as dimension
best,
Sorry the delay. I'm fairly new to Qlik so I had to research expressions as dimensions. I did do that and now it's working perfectly! I appreciate the help!
Rafael,
I did a custom measure for the expression and then selected it. Is that what you were referring to? Either way, it's working when done this way.