How to know what is in context?

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

How to know what is in context?

Post by Jhstephenson »

I am running into a wall with understanding how to know what is in context at a given point in time.

Here is the situation(s):

I am displaying a pie chart in a query. I can do this in two ways:

1. Create a Summary Table that will end up with one record for each of the possible segments on the chart. The summary table has a Product Description and the total count from a Parts Detail table.

2. Use the table with the detail records I am looking for, and have the query aggregate (in this case COUNT) the number of records for each Part Type.

For both methods I can get the Chart to display just like I want it to. No issues on that part of it.

When displaying a chart you can click on a segment and perform some operation. In this case I want to click on a segment and have it run a query to show the individual detail records that made up a chart segment.

Now the issue…

If I use the Summary Table method everything works fine. I tell it to run the query and in the query I have it filter on something like this:

FIND ProductDetails WHERE ProductDetails.Product=ProductSummary.Product ORDER BY ProductDetails.OrderDate DESC

This shows me exactly what I expect; all of the records for the segment that I clicked on.

The record for the segment selected appears to be in context.

The problem comes though, with method #2. I have tried a number of different ways to get this to work, but cannot get it right.
  • I have tried running it basically the same as #1, but have no idea what is actually in Context to know how to format the filter. I have tried:
    FIND ProductDetails WHERE ProductDetails.Product=ProductDetails.Product
    FIND ProductDetails WHERE ProductDetails.Product=ThisProductDetails.Product
    FIND ProductDetails WHERE ProductDetails.Product=ThatProductDetails.Product
  • I have tried running a process where I use ProductDetails as input to the process and try to find the products first and then display the query. That doesn’t work.
  • I have tried running a process that updates a SessionVariable with the Product ID from the Segment, but nothing ever gets into the SessionVariable.

I guess the ultimate question is, how do I know what gets put into context when I click on the segment, so that I can know how to properly format a query or process?

Does this make sense?

Thanks,
Jim
Jaymer
Posts: 2461
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to know what is in context?

Post by Jaymer »

yeah, i hit this the other day and had to resort to the summary table.
hit this wall a few years ago (as I cussed Aware's poor charting) and gave up on internal charts.
that sales demo uses a summary table as well - so the demo "looks" nice, but I'm not a fan of having to do the extra step of another table WHEN, as you see, you can aggregate the data (sum) YET cannot do a damn thing when you click.
its almost like the option "what to do when chart is clicked" should be disabled if you are aggregating anything.

i can ALMOST (i mean barely in the tiniest way) see why this is happening.
if I'm charting sales by Month, my data rows are sales.
So when you click on Jan, there is no single record to pass to the Process... could be 1000s. <-- this is what you are facing here
Personally, I wouldn't want all the rows that make up Jan sales to be in context as you are asking Jim.
All we need is "Jan" to be passed AND THEN I could FIND sales that are in that clicked pie slice... or DISPLAY the query that will only show Jan.
But that too has issues... "Jan" is just the way we displayed the slice. Internally Aware aggregated a bunch of records.
He'd have to pass a repeatable criteria that lets the next Query (grid) find that exact same set of Sales.
So, for example, Some sales recs were Jan 15,16,17 and he has to pass 2 dates somehow into a process of "1-Jan-2022" and "31-Jan-2022"... what BO does he pass these in? Because if he's not going to pass the RowID "In Context", we have to have a find to FIND that same set - Aware doesn't work that way - it works on Context rows being passed - and at some point a large # of recs just can't be passed I feel... so he chose not to do it that way, and we're stuck with a dead end as you and I have discovered this week.
@JIM --> [note: in this example I talked about sales by month. this week though, I was tracking events by Day. so each charted item was in a week, with an AGGREGATE bar PER DAY. So if he just passed 1 record (any record) from that bar IN CONTEXT to my process I could have done a drill down and displayed another chart (or grid, or VP content panel) with all events just on that day. But, as you've found out, nothing comes in via Context, so dead end.]

Drill down is VERY tough - very tough. Its a lot of work to do in HighCharts even though a sample drill down looks simple.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jhstephenson
Posts: 297
Joined: Wed Apr 22, 2015 11:44 pm

Re: How to know what is in context?

Post by Jhstephenson »

Thanks Jaymer,

I see the difficulties, but shouldn't there be one unique value to a segment; whether it be product, employee, or who knows what?

All I need is that unique value be available someplace. Once I have that I can format the following query however it needs to be done.

If Aware is smart enough to know that I clicked on a particular segment, I would think it should know what values are associated with that segment and make them available somewhere.

As a side note to this...
Weren't we supposed to have something that allows us to se what is in context in this most recent version of Aware?
Jaymer
Posts: 2461
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: How to know what is in context?

Post by Jaymer »

Log2 context


If we could persuade Vlad, I think there’s room for additional options related to “when clicked on”
[ ] pass 1 detail row in context - use 1st in series (ie. Lowest ID #)
[ ] assign Session Var attribute ____________ with BO.somefield

Something like this. I think you only need 1 ID from the detail rows and from that you could derive the customer, or Type, or Month, or Category enough to call a subsequent query/process
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply