Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Linking two dates in Set Analysis

I'm trying to link two dates in a Set Analysis. When I do it using an If-statement, it works just fine. But I understand that If-statements are not the ideal solution as they are slow.

How can I achieve that with a Set-Analysis instead?

My expression currently looks like this:

=1/Avg(If(FleetDate=FlightDate, MXRatio))

I tried the following set analysis:

=1/Avg({$< _UtilizationKey = {"=(FleetDate=FlightDate)"} >} MXRatio)

The utilizationkey is just a numeric key field (rowno()) in the same table as the MXRatio, as I read, that it's not possible to use the searched dimension cannot be in the boolean condition.

2 Replies
Gysbert_Wassenaar

If there's only one FleetDate - FlightDate combination per _UtilizationKey value then it should work. If not, then you'll need an if statement. See this document for more information: set_analysis_intra-record.qvw


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks for your reply.

There is one _UtilizationKey per records, as I create it during the load with a RowNo() function.

The FleetDate field is currently holding only one date (today's) and in the FlightDate there are multiple dates, ranging from 8.3. - 21.3.

So yes, there should be a combination of FleetDate to FlightDate