Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
shiveshsingh
Master
Master

Latest Non Zero Value in Script

Hi All

Please refer below sample data set.

DateValue
01-06-201945
02-06-201912
03-06-2019100
04-06-20190
05-06-201910
06-06-20195
07-06-20190
08-06-20190
09-06-201910

 

Requirement is, If i run script on 7June, then  5 ( Latest Non Zero Value) should be stored(In script Only).

If I run the code on 8th, only 5 should come but when i run code on 9th, that 5 should be overridden by 10.

 

Please help for the code in script.

4 Replies
martinpohl
Partner
Partner

Hi,

for this load

Max:

max(Date) as MaxDate

resident YourData

where Value > 0;

left join load

Date as MaxDate

Value

resident YourData;

drop table YourData;

Regards

sunny_talwar

Where exactly are you looking to store this? In a variable or a table?

shiveshsingh
Master
Master
Author

@sunny_talwar 

I have a table with fields [Extraction Date],

[Date type],
[Object type],
[Object type sort order],
[Data / Valueset / Object],
[Domain / System],
[Table],
[Process Area],
[System sort order],
Client,
[# of correct records],
[# not correct records],
[# of records] 

 

I just want to store all the latest value in a table where [# of records]  is not zero 

sunny_talwar

May be do this

Right Join (TableNameHere)
LOAD Max([Extraction Date]) as [Extraction Date]
Resident TableNameHere
Where [# of records] <> 0;