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

"Read" and "Filter" table by other tables Column Name (Depending on cursuor position)

Hello, 

I will need to filter the Actions based on my cursor positon within the Statustable. E.g if I click a date within column TOSV34 the table below supposed to only show Action 34, in case I click within column TOSV100 respectively only action 100. 

Best Regards 

Timo 

Labels (4)
1 Solution

Accepted Solutions
marcus_sommer

It doesn't sound like a special difficulty else like a normal task. I could imagine just to join/map the plan-dates against current-dates and calculating there differences and further flagging/clustering/scoring them as well as the above mentioned counting/ordering/ranking them in regard to the order and order-line.

Further I think I would concatenate these plan-date to the current-data by harmonizing fields and values as much as possible and also adding a source-field with values like 'current' and 'plan'. Because like already hinted it are mainly the same data - only the direction is different. Also checking both sides against each other to flag which plan-tasks are already fulfilled and which not maybe useful to select easily completed tasks or open ones and also those which were not planned or changed/discarded ... whatever.

All this may cause a bunch of various transformation-steps but are not very complex. If these kinds of information are needed the work has to be done - in this way or another - but each other method will be harder ... 

View solution in original post

13 Replies
marcus_sommer

The associations between the data aren't suitable for your wanted view. I'm not sure if there is a possibility to create such association between multiple date/status fields and the other parts of your data-model without ending in synthetic keys and/or circular loops and/or link-table models but if it would be rather complex and expensive.

Better would be not to use crosstable-structures else just having a single date-field and a single status-field which are associated to the order-information.

TimoHart
Contributor III
Contributor III
Author

Hi Marcus, thank you. I will not be able to work without the crosstable structure as the data is SAP output as is. Listed like shown. One Table with Actions Column and Date Column the other table with the Projects Infomtion.

Common is the Order Number (WBS) . To have the Actions not listed in rows but in columns to the respective Order I need the generic load function.   Actually this is what I believe so far. 

2nd what excactly do you mean by having a single Date field and a single Status field ?

Regards Timo

marcus_sommer

The header of the SAP table contains the status and the rows multiple dates. Therefore by applying a crosstable-load you would end with a status-field as a dimension and value-field with the various dates as dimension/measure-field. Now the wanted oder-area could be selected and the possible status/date-values remain and could be itself selected and/or specified within a set analysis to going deeper. For the most views this will be sufficient.

TimoHart
Contributor III
Contributor III
Author


@marcus_sommer wrote:

The header of the SAP table contains the status and the rows multiple dates.Therefore by applying a crosstable-load you would end with a status-field as a dimension and value-field with the various dates as dimension/measure-field. Now the wanted oder-area could be selected and the possible status/date-values remain and could be itself selected and/or specified within a set analysis to going deeper. For the most views this will be sufficient.

 


Sorry I know this is confusing but what you see here is not the SAP output but an already transposed listing !

In this TOPIC which is somehow independent from my others, I want to parallely check further challanges after sorting my other issues. So please consider the screenshot not to be the actual table yet. I know this is confusing,but my intention for THIS topic is to access / read the HEADERS title "TOSV34" and use it as condition. Possibly this is completly off QLIKs philosophy so dont worry ,simply let me know.   To get complete Picture of my chalange you might want to see the startup Solved: Re: New Table from 3 filtered CSV files (Transpose... - Qlik Community - 2142451 

Imagine attached screenshot is the challange. At the moment "Status" + "Action"  + "Dates"  ) are all values dedicated to the ORDER. Single ROW per "Action" ! This is why I need the Generic Load. I do not understand why you talking about crosstable function. 

well,  as mentioned this topic shall clarify on how to indcate my cusor position ? future challenge !  How to "read" the columns header ... and possibly use it elsewhere ? 

Best Regards 🙄 & sorry if  I am too far from QLIK phylosophy with what i want to do - and also might not easily understand your explanations. 

 

Best Regards 

Timo 

marcus_sommer

I doubt that you need a generic load to transform a normal record into a crosstable-structure - especially within the final data-model and the UI. For some intermediate measures it might be useful but in a final application it's very hard to handle. Nearly everything is much easier possible with normal data-structures. In your case a base-table with:

OrderKey   Order   Date   Status

should be sufficient to enable all relevant associations and selections. Date and Status would be linked with appropriate dimension-tables and providing month + year +++ to the dates and various upper/lower grouping & descriptions to the status.

On this base is much more possible, for example to count/rank/sort the number of Status per Order and/or calculating the offset between the Dates/Status and/or deriving any scoring within a chain of events and surely much more - just by using interrecord-functions like peek() and previous() within a sorted resident load, maybe with something like this:

t: load *, if(Order = previous(Order), Date - previous(Date), 0) as DateOffset;
                  if(Order = previous(Order), 1 + peek('OrderRank'), 1) as OrderRank
resident Source order by Order, Date desc;  

left join(t) load Order, count(Date) as OrderCount
resident t group by Order;

TimoHart
Contributor III
Contributor III
Author

Thanks Marcus ... even if it seems the problem did not quite reach you yet . (Sorry my understanding cause you subtracting dates 🤔 ) , I could move further by your excample...  now how to get rid of the empty cells ... and show all data in one row dedicated to the WBS ( Orderkey ) ?  This looks already great for me .. 

guess I do need to get basic training on the JOIN phylosophy .. or somehow get it together in the sheet. Guess grouping is not an option really ? BR Timo

marcus_sommer

Beside the efforts to position multiple date- and status-fields as filter-boxes and to address them as dimensions and measures within the objects as well as synchronizing them - the shown empty cells in the table are a good example of the weakness of such an approach. If it were not associated tables else they would be joined these empty cells could be avoided - but in my experiences it's further not an expedient way.

To generalize it a bit more. Your data have all an equally content - just the dates and status change per order several times. It could be regarded more or less as the perfect data-structure. If it hadn't this structure all kind of possible ETL tasks should be applied to create such a data-structure to end with a star-scheme data-model with a single fact-table (all relevant information are horizontally and vertically merged by harmonizing the field-names and field-values as much as possible) and n surrounding dimension-tables. A bit idealized the fact-table would just contain multiple ID's to the various dimensions and a single KPI field and a single VALUE field. And a bit exaggerated expressed: the more de-normalized the data-set is the easier will be the handling and also the better the performance.

Of course other data-models are possible but usually they have massive disadvantages in regard to efforts and complexity as well as in the performance and usability. Therefore why not starting with the most simple approach and only if some specific requirements are not (practically) possible to extend it or switching to other solutions.  

TimoHart
Contributor III
Contributor III
Author


Hi Marcus , thank you - even I understand only parts of what you want to tell me I do understand that :

"just the dates and status change per order several times."  is not 100% of what is happening. 

Its the Date AND Status which changes per Order @ serveral Actions. This is why I do have the intention to transpose or anything like it.

BR. Timo     

marcus_sommer

For me it looked like a very common data-set. An order is created and creates a timestamp and a status like 'started' and afterwards the status changed to 'approved', 'shipped', 'completed', whatever and maybe not for the entire order else differently for each order-line.

Just using a pivot-charts with order and order-line as vertically dimensions and status as horizontal dimension and the dates as measure will display the entire chain of events. By selecting certain periods (connected per master-calendar) and/or certain status and/or groupings of them the data-set view could be appropriate adjusted.

That's the main-structure and should ensure all relevant associations between the data. On top of it all necessary information could be created like hinted above to count/rank/order them and/or calculating offsets and scores or whatever which are then used as measures or as dimension - maybe replacing the status as horizontal dimension and using it as measure instead of the dates. Many different views will be possible and I assume most of your requirements could be addressed with such simple method.