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

calculations in empty table

Hi guys,

Could you please help me with one question. How to calculate max, min values in empty resident table or qvd file in the script. It's returns Min, Max value as empty value, but I would like to substitute these with '0' and to assign these to variables. Please see attached files. I know that is possible to calcualte count of records in that way as

LET a = NoOfRows('tab1').

Thanks for any help.

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

FactCollFull:

Load

Count(DW_LOAD_ID) as FactCollFullCount,

Min(DW_LOAD_ID) as Min_DW_LOAD_ID,

Max(DW_LOAD_ID) as Max_DW_LOAD_ID

FROM FACT_COLL_FULL.QVD(qvd);

 

Let v_TableName = 'FACT_COLL_FULL';

Let v_RecordCount = rangemax(0,peek('FactCollFullCount',0,FactCollFull));

Let v_MinDwLoadId = rangemin(0,peek('Min_DW_LOAD_ID',0,FactCollFull));

Let v_MaxDwLoadId = rangemax(0,peek('Max_DW_LOAD_ID',0,FactCollFull));


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Try:

FactCollFull:

Load

Count(DW_LOAD_ID) as FactCollFullCount,

Min(DW_LOAD_ID) as Min_DW_LOAD_ID,

Max(DW_LOAD_ID) as Max_DW_LOAD_ID

FROM FACT_COLL_FULL.QVD(qvd);

 

Let v_TableName = 'FACT_COLL_FULL';

Let v_RecordCount = rangemax(0,peek('FactCollFullCount',0,FactCollFull));

Let v_MinDwLoadId = rangemin(0,peek('Min_DW_LOAD_ID',0,FactCollFull));

Let v_MaxDwLoadId = rangemax(0,peek('Max_DW_LOAD_ID',0,FactCollFull));


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks you very much , but in line Let v_MinDwLoadId = rangemin(0,peek('Min_DW_LOAD_ID',0,FactCollFull));

should be used rangemax, if table doesn't empty.