Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
AuroraK
Contributor II
Contributor II

Set expression

Hi all, 

Trying to achieve the below, I have a combo chart with 2 dimensions (1 of which is alternate dimension) and 2 measures.
Dim1 is Date and Dim2 is Weekstart

Measure:
if((GetSelectedCount(weekstart)) >0,
// Logic for when weekstart is selected
(Sum({<weekstart = {">=$(=Date(max(weekstart)-49)) <= $(=Date(max(weekstart)))"}>} value1) +
Sum({<weekstart = {">=$(=Date(max(weekstart)-49)) <= $(=Date(max(weekstart)))"}>} value2)),
if((GetSelectedCount(date)) >0,
// Logic for when full_date is selected
(Sum({<date= {">=$(=Date(max(date)-13)) <= $(=Date(max(date)))"}>} value1) +
Sum({<date= {">=$(=Date(max(date)-13)) <= $(=Date(max(date)))"}>} value2)),
// Default logic if neither is selected
(Sum({<date= {">=$(=Date(max(date)-13)) <= $(=Date(max(date)))"}>} value1) +
Sum({<date= {">=$(=Date(max(date)-13)) <= $(=Date(max(date)))"}>} value2))
)
)

I am trying to set expression in such a way that by default the chart should show last 14 days, and when select date or week is selected the last 14 days and 7 weeks from the date selected. By default expression works perfect, it's just when I select any date in the filter it gives me extra dates in the chart.

AuroraK_0-1730265843347.png

 

Labels (7)
1 Reply
ramazanerduran
Partner - Contributor III
Partner - Contributor III

Hi @AuroraK,

 

Could you please create a simple bar chart, put date on dimension and create a simple measure such as sum(sales). Then pick a couple of date and provide a screenshot if same issue occured. If its not the problem may be occured from the additional dimension.

 

Thanks,

Ramazan