Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
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

but they cant be in the same table the datefrom field needs to be on its own in a data island for your solution to work.

At the moment selecting datefrom is filtering all your data including date down to just that selection cause its part of the same tableA dimension.

 

qliker3
Creator
Creator
Author

i reverted the original chart and added one more chart but only with datafrom as dimension and Avg({$<[Table.Country]={"Germany"}, Date={">$(vMaxDate)"}>} $(anotherVar)) as measure. It still shows only one bar

ogster1974
Partner - Master II
Partner - Master II

make the dimension of your chart Date not date from.

qliker3
Creator
Creator
Author

still no changes 

ogster1974
Partner - Master II
Partner - Master II

show me your data model is it linked in any way between Date Table and date from table.

qliker3
Creator
Creator
Author

LOAD
DateKey,
Date(Floor(DateHour - MakeTime($(i))), 'DD.MM.YYYY hh:mm:ss') as Date,
Date(Floor(DateHour - MakeTime($(i))), 'DD.MM.YYYY hh:mm:ss') as DateFrom

ogster1974
Partner - Master II
Partner - Master II

You are joining the tables hence its filtering to the one date you select.  Don't include Date in the same table or date key in the same table as datefrom

Make a data island i.e. no link to other data.

LOAD
Date(Floor(DateHour - MakeTime($(i))), 'DD.MM.YYYY hh:mm:ss') as DateFrom

Then you can use it to set the date range independently of your transactional data.

 

qliker3
Creator
Creator
Author

i removed date from the load script and only left datefrom, still only one bar in chart. 

ogster1974
Partner - Master II
Partner - Master II

I'm not sure I can be much more help I can't see what you are doing.  The solution I originally proposed will work if applied correctly and the data is modelled correctly.

 

qliker3
Creator
Creator
Author

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

should it be Date or DateFrom? With Date (as a function, not column) it gives one bar. With DateFrom=... it gives undefined values