Qlik Community

Qlik Sense App Development

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

joeybird
Contributor II

Chart always displays 30 days of data from chosen date

Hi

I want a bar chart to display individual sales data for 30 days from a chosen date

when a 'SalesDate' is chosen from a filter pane

I have made an expression that fixes current 30 days from max(SalesDate)

how can the expression be changes to chart dynamically changes to show 30 days sales from another chosen Sales Date?

Please help

1 Solution

Accepted Solutions

Re: Chart always displays 30 days of data from chosen date

Mark

I will probably add the Date function and dollar sign expansion in there:

Sum({<SalesDate = {"$(='>=' & Date(Max(SalesDate)-30, 'YourDateFieldFormatHere') & '<=' & Date(Max(SalesDate), 'YourDateFieldFormatHere'))"}>} Measure)

Here YourDateFieldFormatHere is a placeholder and needs to be replaced with your Sales date field format.

5 Replies
mark6505
Valued Contributor III

Re: Chart always displays 30 days of data from chosen date

HI

Try

SUM({<SalesDate={'>=Max(SalesDate)-30,<=Max(SalesDate) '}>}Value)

Mark

Re: Chart always displays 30 days of data from chosen date

Mark

I will probably add the Date function and dollar sign expansion in there:

Sum({<SalesDate = {"$(='>=' & Date(Max(SalesDate)-30, 'YourDateFieldFormatHere') & '<=' & Date(Max(SalesDate), 'YourDateFieldFormatHere'))"}>} Measure)

Here YourDateFieldFormatHere is a placeholder and needs to be replaced with your Sales date field format.

joeybird
Contributor II

Re: Chart always displays 30 days of data from chosen date

Hi

this works, thank you however on the chart it does not allow you to drill down further on the chart to a single Sales Date

is this please possible?

please help

Re: Chart always displays 30 days of data from chosen date

I thought you wanted to see 30 days from your max selected date? How would the expression know when to show 30 days and when to show just a single day?

joeybird
Contributor II

Re: Chart always displays 30 days of data from chosen date

Hi

added to the load an extra line

SalesDate,

date(SalesDate) as SDate,

used SDate as dimension, used your expression and it worked

thank you x

Community Browser