Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
QVUser1
Partner - Contributor III
Partner - Contributor III

Fixing the Base Value From Field

Hi,

As We are aware of that Diesel Price changes from day to Day. here in my Scenario The diesel Rate is changing from day basis. here i want to fix the base rate when there is only difference between the diesel rate is Above 1.00 Rupee.

Please find the attachments & Excel For the Information.

Please let me Know Any details Required

1 Reply
techvarun
Specialist II
Specialist II

Try below script

SET ThousandSep=',';

SET DecimalSep='.';

SET MoneyThousandSep=',';

SET MoneyDecimalSep='.';

SET MoneyFormat='₹ #,##0.00;₹ -#,##0.00';

SET TimeFormat='hh:mm:ss';

SET DateFormat='DD-MM-YYYY';

SET TimestampFormat='DD-MM-YYYY hh:mm:ss[.fff]';

SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';

SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';

SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';

SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';

SET FirstWeekDay=0;

SET BrokenWeeks=1;

SET ReferenceDay=0;

SET FirstMonthOfYear=1;

SET CollationLocale='en-IN';

Base:

LOAD *, if(Difference > 1, Floor(Rate))as  BasePrice INLINE [

    Date, Rate, Difference

    10-07-2017, 57.85, 1.05

    11-07-2017, 58.13, 0.28

    12-07-2017, 58.13, 0.28

    13-07-2017, 58.07, 0.22

    14-07-2017, 58.04, 0.19

    15-07-2017, 58.24, 0.39

    16-07-2017, 58.32, 0.47

    17-07-2017, 58.39, 0.54

    18-07-2017, 58.45, 0.6

    19-07-2017, 58.45, 0.6

    20-07-2017, 58.44, 0.59

    21-07-2017, 58.43, 0.58

    22-07-2017, 58.35, 0.5

    23-07-2017, 58.33, 0.48

    24-07-2017, 58.33, 0.48

    25-07-2017, 58.27, 0.42

    26-07-2017, 58.3, 0.45

    27-07-2017, 58.34, 0.49

    28-07-2017, 58.42, 0.57

    29-07-2017, 58.61, 0.76

    30-07-2017, 58.73, 0.88

    31-07-2017, 58.94, 1.09

    01-08-2017, 58.99, 0.05

    02-08-2017, 58.95, 0.01

    03-08-2017, 59.18, 0.24

    04-08-2017, 59.45, 0.51

    05-08-2017, 59.69, 0.75

    06-08-2017, 59.92, 0.98

    07-08-2017, 60, 1.06

    08-08-2017, 60.12, 0.12

    09-08-2017, 60.18, 0.18

    10-08-2017, 60.18, 0.18

    11-08-2017, 60.21, 0.21

    12-08-2017, 60.57, 0.57

    13-08-2017, 60.67, 0.67

    14-08-2017, 60.77, 0.77

    15-08-2017, 60.73, 0.73

    16-08-2017, 60.79, 0.79

    17-08-2017, 60.83, 0.83

    18-08-2017, 60.71, 0.71

    19-08-2017, 60.61, 0.61

    20-08-2017, 60.49, 0.49

    21-08-2017, 60.42, 0.42

    22-08-2017, 60.46, 0.46

    23-08-2017, 60.46, 0.46

    24-08-2017, 60.47, 0.47

    25-08-2017, 60.43, 0.43

    26-08-2017, 60.37, 0.37

    27-08-2017, 60.45, 0.45

    28-08-2017, 60.44, 0.44

    29-08-2017, 60.43, 0.43

    30-08-2017, 60.42, 0.42

    31-08-2017, 60.47, 0.47

    01-09-2017, 60.55, 0.55

    02-09-2017, 60.64, 0.64

    03-09-2017, 60.71, 0.71

    04-09-2017, 60.81, 0.81

    05-09-2017, 60.9, 0.9

    06-09-2017, 60.9, 0.9

    07-09-2017, 61.05, 1.05

    08-09-2017, 61.27, 0.22

    09-09-2017, 61.54, 0.49

    10-09-2017, 61.87, 0.82

    11-09-2017, 62.14, 1.09

    12-09-2017, 62.25, 0.11

    13-09-2017, 62.27, 0.13

    14-09-2017, 62.3, 0.16

    15-09-2017, 62.28, 0.14

    16-09-2017, 62.39, 0.25

    17-09-2017, 62.43, 0.29

    18-09-2017, 62.49, 0.35

    19-09-2017, 62.4, 0.26

    20-09-2017, 62.33, 0.19

    21-09-2017, 62.25, 0.11

    22-09-2017, 62.22, 0.08

    23-09-2017, 62.25, 0.11

    24-09-2017, 62.26, 0.12

    25-09-2017, 62.28, 0.14

];

Base1:

noconcatenate LOAD Date,Rate,Difference, if(IsNull(BasePrice), Peek(BasePrice), BasePrice) as BasePrice Resident Base;

DROP Table Base;