Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
tvsr111
Contributor II
Contributor II

Conditionally Clear selections


* We have a Flying Table with Dates

* A star schema with Fact & Dimensions. Fact Table has 2 date columns as Valid_From_Date & Valid_To_Date

FlyingTable has not relation with Fact table model


craeted a variable: varDateSelected=coalesce(GetFieldSelections(DateValue),today())


Later I have create some Dimesions and Measures by referring to the Date selected on FlyingTable

for example:

LineofBusiness: if(varDateSelected>=Valid_From_Date and Valid_To_Date<=varDateSelected, [LineofBusiness], null())

Sales: if(varDateSelected>=Valid_From_Date and Valid_To_Date<=varDateSelected, [Sales], 0)

 

By doing so, the visualizations and data are working all fine.


But there is a problem when we make any selection by a Dimension value.

For example, if I select LineofBusiness dimension to a vlaue like 'Fleet'.... the visualization is changing based on varDateSelected+'Fleet'

for this one selction made on visualisation, on the Selections area in top, we see 3 selections based on Valid_From_Date & Valid_To_Date & LineofBusiness values

then when I undo the LineofBusiness from selections panel.... the other 2 selections on Valid_From_Date & Valid_To_Date stays on.
And that limits data to teh dates relevant to earlier selection only.


so basically what we want to, when all the manually made selection are cleared, I want to clear other implicit selections

or may be some code to run when ever any selctions are cleared... it should run and check how many selection do exist if the count>2, then we should able to clear all the selection


Not sure if we are asking tooo much from qliksense

 

 

0 Replies