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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Show or hide value, depending on previous period.?

Hi all,

I am trying to show a record, or exclude it, based on whether it has been populated in a previous period.

For example, if field A is NULL in period 2, with a value of X in period 3 - show the record in a QV model.

Then where the field is not NULL in a period 2, then exclude the record from the QV model.

I'm still trying to get my head around this one.

Absolutely any ideas would be appreciated.

Many thanks!

1 Reply
john_duffy
Partner - Creator III
Partner - Creator III

Hello.

Just an idea - You can set a flag based on whether or not the field has a null value. Then reload the resident table and use the flag to determine whether or not to include or exclude it. In your example above, you could do something like:

TestTable: Load Field, Period, if (not isnull(Field),'Y','N') as Field_Has _Value From ???.QVD;

TestTable2: Load Field, Period Resident TestTable;

Left Join Load Field, Field_Has_Value Resident TestTable Where Field_Has_Value = 'Y';

FinalTable: Load Field, Period Resident TestTable2 Where Field_Has_Value = 'Y';

I have not tested this code but it should give you all Field/Period combinations where Field has a value in at least one period.

Hope this helps.