Discussion Board for collaboration on QlikView Scripting.
Hey guys! I need your help to translate a calculated field in excel to qlikview script.
I have this table in excel
I need to generate new fields that I could perform in Excel but in the script
For the field Q_DAYS I made the following formula in Excel: DATE_TO - DATE_FROM + 1
For the field TOTAL_Q_DAYS I made =+MAX(date_to)-MIN(DATE_from)+1
For the Field Q_DAYS_REASON i made the following: the Q_DAYS for the min value of (date_from) is the same and in the second field I made =+IF(QDAYS>previous(Q_DAYS),Date_to-previous(Date_to),0)
What i need to do in this field is calculate If this date_To is greater than the previous date_to, add up the difference between the dates_to
what is the expected output? I am confused
kushal i need to generate a table like the second one, with the fields Q_DAYS, Q_DAYS_REASON and TOTAL_Q_DAYS
I made an excel like the attachment but i need to make the fields in a large table in qlikview script.
I hope I have explained well
thanks in advance!
Date(If(ID = Previous(ID), RangeMax(Peek('date_to'), Peek('max_date_to')), date_to)) as max_date_to,
If(ID = Previous(ID), If(date_to > Previous(date_to), RangeSum(date_to, -RangeMax(Peek('date_to'), Peek('max_date_to'))), 0), date_to - date_from + 1) as Q_DAYS_REASON;
LOAD RecNo() as SerialNo,
date_to - date_from + 1 as Q_DAYS
(html, codepage is 1252, embedded labels, table is @1);
Left Join (Table)
Max(date_to) - Min(date_from) + 1 as TOTAL_Q_DAYS
Group By ID;