Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have an orders table with 3 date fields - OrderDate, SupplyDate, PaymentDate. This table is linked to a single calendar table through a bridge table (for different date types).
The users selected which date type they wanted to see the data by. Until now, a 'date type' filter was used and everything worked fine.
It was necessary to remove the filter, and now I using a variable (that received the selected date type), buttons that updates the value of the variable, and I placed it inside a set analysis.
The issue is with the details table, where all the order information is displayed, including the 3 dates. I am unable to implement the use of the variable successfully.
It does work for me when the user selects a continuous period (January-March 2025 for example). In this case, I use variables that store the min selected date and the max selected date.
For example, for OrderDate the dimension formula is:
If(vDateSelected = 'OrderDate',
If(OrderDate >= vMinSelectedDate and OrderDate <= vMaxSelectedDate, OrderDate, null()),
OrderDate
)
You could try to explore the possibilities of using set analysis with impicit field value modifiers.
I don't know the details of your datamodel nor variables, but you could try something in the style like this:
If(vDateSelected = 'OrderDate', only({<OrderDate=P(Date)>}OrderDate))
May be this
If the user has selected a date, only display the corresponding date field if that date exists within the selected calendar dates.
=If(vDateSelected = 'OrderDate',
If(WildMatch(OrderDate, P(CalendarDate)),OrderDate,Null()),
OrderDate)
If the user selects the periods - you won't need any queries to them to define dimension/expression conditions else the native Qlik usability will do the job.
Beside this I suggest to rethink the data-model because within the most scenarios it doesn't need a bridge-table else a single date-field in the facts + source-information (order, supply, payment) is enough to differentiate between them and each record could - with a few simple mappings - within a flag-field know which other parts already exists.