Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
qliker3
Creator
Creator

Show data in a diagram from selection onwards

Hi,

I have a diagram with "date" as one of the dimentions.  Additionally i have a filter with DateFrom (the copy of the date column). I want to pick a date from and show dates from this filter and onwards in the diagram. For this i have written this expression 

=if(Date([TableD.Date], 'DD.MM.YYYY')>GetFieldSelections(Date(TableD.DateFrom, 'DD.MM.YYYY')), Date([TableD.Date], 'DD.MM.YYYY'))

why doesnt this work? And how can i fix it? 

Thanks 

20 Replies
ogster1974
Partner - Master II
Partner - Master II

create a variable Let vMaxDate = Max(TableD.DateFrom) // latest selected/available value

Then in you measure sum({<DateFrom={">$(vMaxDate)"}>} value)

 

qliker3
Creator
Creator
Author

why in measure sum({<DateFrom={">$(vMaxDate)"}>} value)? I want to filter dates on dimension. I have something else in measure

ogster1974
Partner - Master II
Partner - Master II

you can add more than the date criteria in the measure.

if its all wired up correctly then it should work as your variable value will be set by your selected DateFrom value.  This will reduce the number of dimension in your chart down to those present in your measure.

qliker3
Creator
Creator
Author

how do i combine it with this expression: 

Avg({$<[Table.Country]={"Germany"}>} $(anotherVar))

qliker3
Creator
Creator
Author

here's an example 

qliker3_0-1675080585375.png

i should be able to choose on filter pane 01.11.2022 and show data starting at this date onwards. In measure i have Avg({$<[Table.Country]={"Germany"}>} $(anotherVar))

ogster1974
Partner - Master II
Partner - Master II

Avg({$<[Table.Country]={"Germany"}, Date={">$(vMaxDate)"}>} $(anotherVar))

doesn't work if you select that date?

qliker3
Creator
Creator
Author

no it shows only one bar, i need from this bar onwards 

ogster1974
Partner - Master II
Partner - Master II

whats the value of $(vMaxDate) when you select the date?  does it match your selection?

is your dimension your using Date or Datefrom sounds to me like your using the filtering date in your chart hence its going to one bar.  

If your datefrom an island in your script or linked to your transactional table?

qliker3
Creator
Creator
Author

in dimention i tryed both date and dateFrom. 

vMaxDate is 08.01.2023 00:00:00.

dataFrom is just a copy of date column. I have createdit because i need have two columns in filter pane. One shoud filter out one day. The other one should show from that day onwards