Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
cramkumar86
Contributor III
Contributor III

ODAG to show both selected and optional values

Hi,

I have a ODAG selection app where I would expect user to make a selection in the Date filter. He might select multiple values.

When I use $(odag_business_date) or $(odags_business_date) , the on-demand app that was generated only has the values that are selected in the selection app. Although this is expected, I am facing issues with showing MTD, YTD and LTD numbers. As the Qlik calculations expect all data to be available to show the right numbers, I need both selected and optional values to be available on the generated detailed app. Removing this field from the binding expression will help, but users wont see the dates selected in the detailed app by default. I dont want users to manually select the dates in detailed app once again.

Is this possible?

Labels (3)
2 Solutions

Accepted Solutions
cramkumar86
Contributor III
Contributor III
Author

We expect to have huge volumes in BigData and loading a massive amount of data in the regular app could cause performance issues. Hence, the need to have on-demand apps generated based on selections. Just wanted to see if ODAG can be leveraged.

Date filter is the only one where I expect all values to be available. Other filters are doing fine with ODAG. Rather than having Qlik perform the YTD, MTD and LTD calculations, I guess these can be done at the database layer and have Qlik load only the data for selected dates.

On the performance front, could direct discovery be an alternate option?

View solution in original post

Or
MVP
MVP

I've never used Direct Discovery, so I'm no help there.

ODAG can be leveraged. From the sound of it, you may want to simply not pass the date parameter at all and simply load all the dates for the template app. If that still results in a reasonable volume / load time, you can do that and presumably resolve the issue (you'd also want a default bookmark assigned with =business_date=Max(business_date) or something of that nature to have a default selection). If that results in slow loads or oversized apps, and you do need all of the possible dates, then you'd have to look at other options.

View solution in original post

8 Replies
Or
MVP
MVP

By default, odag_ will generate an app with all possible values (green and white).

If you'd like to create an app that gets data outside that scope (for example, YTD even though a single date has been selected), there's no problem doing that. For example, you can bind business date and then in your template app use e.g.

Load *

From SomeTable

Where BusinessDate >= YearStart($(odag_business_date));

 

cramkumar86
Contributor III
Contributor III
Author

Sure. Thanks for the response. 

In this case, the default behavior of odag_business_date should help if it is supposed to include both selected and optional values. I am not sure why I see only the selected date despite using the below statement.

WHERE MATCH (business_date, $(odag_business_date)). 

Could there be an issue with format of the date?

Or
MVP
MVP

If you have selected a single date in this field, you will get a single value passed to the template app because there are no other selected/optional values (green/white respectively). I'm not sure what sort of result you're expecting - if users are trying to view multiple business dates, I would expect them to either select multiple business dates, or if they're trying to view multiple business dates by selecting e.g. a year, then I would expect them to select a year which would leave the relevant business dates optional (white).

 

cramkumar86
Contributor III
Contributor III
Author

Ok, I understand now. It makes sense why I see only the selected date(s) on the template app. 

In the actual requirement, we have close to 90 business dates in the Date filter that includes some of the latest dates and historic ones that would span across the last 7 years. So the date could be anything.

To make it easier to follow, lets imagine that we have 4 business dates in the Date filter. Jan 31st, Feb 28th, Mar 1st and Mar 31st. 

When I select Jan 31st, the data corresponding to the selected date is appearing in the template app and the date filter only has Jan 31. But unfortunately, the MTD, YTD and LTD arent showing as expected as the data for dates that werent selected are not available. My expectation is that all dates should be available in the template app and only Jan 31st should be selected by default.

Removing the binding expression for business days would make user select the date again on template app.

Or
MVP
MVP

What you're describing doesn't sound like an ODAG app - it sounds like a regular app. If all of the values need to be available, then why are you using ODAG in the first place?

cramkumar86
Contributor III
Contributor III
Author

We expect to have huge volumes in BigData and loading a massive amount of data in the regular app could cause performance issues. Hence, the need to have on-demand apps generated based on selections. Just wanted to see if ODAG can be leveraged.

Date filter is the only one where I expect all values to be available. Other filters are doing fine with ODAG. Rather than having Qlik perform the YTD, MTD and LTD calculations, I guess these can be done at the database layer and have Qlik load only the data for selected dates.

On the performance front, could direct discovery be an alternate option?

Or
MVP
MVP

I've never used Direct Discovery, so I'm no help there.

ODAG can be leveraged. From the sound of it, you may want to simply not pass the date parameter at all and simply load all the dates for the template app. If that still results in a reasonable volume / load time, you can do that and presumably resolve the issue (you'd also want a default bookmark assigned with =business_date=Max(business_date) or something of that nature to have a default selection). If that results in slow loads or oversized apps, and you do need all of the possible dates, then you'd have to look at other options.

cramkumar86
Contributor III
Contributor III
Author

Many thanks for your suggestions. Much appreciated!