Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Confused about displaying limited information in table

I have a fact table that contains the history of any changes to an object, this contains a ValidFrom and a ValidTo field, denoting when the state became current and when it was replaced.

I can show a table which contains all the history, which I can then filter but I would ideally like to be able to have a table for my users to be able to look at only the current entries (i.e. the entries where the ValidTo field is null), I've looked around and it sounds like you can't do that sort of thing with a basic table, but you could potentially do it with a table chart. I was wondering whether anyone has any resources which would explain how I can show all the fields in a table chart where a field is a particular value or know of a better way of achieving this effect?

Thanks for any help/advice in advance

Sam

UPDATE:

Is an acceptable way of achieving this to create a separate table within QlikView based on the resident table?

i.e.

t_latest_state:

load * Resident Object_State where isnull(Object_State.ValidTo);

Message was edited by: Sam Jenkins To provide an alternative idea of how to achieve this

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can load another table with only the latest_state, but I don't recommend it. That would at the minimum duplicate data, but could also cause non-trivial performance degradation. A better idea is to create a new field:

Object_State:

load *, if(len(trim(Object_State.ValidTo))=0, 1, 0) as IsCurrent

from ...object_state_source...;

You can use the new field IsCurrent to select current, historic or all values. You could add a listbox for the field so users can select what they want to see. Or you can use it in set analysis expressions. For example a sum(Sales) would become sum({<IsCurrent={1}>}Sales) to consider only the records that are current.


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can load another table with only the latest_state, but I don't recommend it. That would at the minimum duplicate data, but could also cause non-trivial performance degradation. A better idea is to create a new field:

Object_State:

load *, if(len(trim(Object_State.ValidTo))=0, 1, 0) as IsCurrent

from ...object_state_source...;

You can use the new field IsCurrent to select current, historic or all values. You could add a listbox for the field so users can select what they want to see. Or you can use it in set analysis expressions. For example a sum(Sales) would become sum({<IsCurrent={1}>}Sales) to consider only the records that are current.


talk is cheap, supply exceeds demand
Not applicable
Author

Perfect thank you for the clarification