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

Period of activity

Hi

I have some difficultes with data Load/Analyse when we have daily date and data wich valid for different periods.


for example:

I have two tables

1. daily actual data : date, actual value

2. normatives data :  starting date, normative value

I need to compare daily values with normatives wich was valid in chosen dates/periods

Which way is correct: load a sertain table

or

write an expression in QlikSense report?

How do you think?

1 Reply
Not applicable
Author

I solved this issue by writing the following script:

SafetyStock_Norm:

LOAD * INLINE

[      DateSS,       SafetyStock

     01.01.15,      645

     10.01.15,      245

     12.02.15,      347

     01.03.15,      127

     01.07.15,      221 ];

TempSafetyStock:

LOAD

     *,

     rowno() as RowCounter,

     -Num(Date# (FieldValue('DateSS',recno())))+Num(Date#(FieldValue('DateSS',recno()+1))) as Duration

Resident SafetyStock_Norm;

For each a in FieldValueList('RowCounter')

     NEWTABLE:

     Load

          Date(FieldValue('DateSS', $(a))+iterno()-1) as NewDate,

          FieldValue('SafetyStock',$(a)) as SS

     Autogenerate 1 While iterno()<=FieldValue('Duration',$(a));

next a;

Drop Table TempSafetyStock;

NEWTABLE is a table for concatinating and analysing it with any table of actual daily data,

But I think there is a better solution.