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

autogenerate prices

Hi All, I'm sure there is a very easy answer to this, but something I cant find. Currently trying to generate two min and max price fields with values between 0 and 1m with a step of 10p, for example 0,10p, 20p, 30p and so on. Does anyone have any examples of how best to achieve. Current script returns 0, 0.1, 0.2, 0.3 and can't seem to format correctly. Thanks -------- current script: Min_Price: LOAD     RecNo()-0.10 AS "Min Price 1",     RecNo()-0.20 AS "Min Price 2",     RecNo()-0.30 AS "Min Price 3",     RecNo()-0.40 AS "Min Price 4",     RecNo()-0.50 AS "Min Price 5",     RecNo()-0.60 AS "Min Price 6",     RecNo()-0.70 AS "Min Price 7",     RecNo()-0.80 AS "Min Price 8",     RecNo()-0.90 AS "Min Price 9",     RecNo()-1  AS "Min Price 10",     RecNo()-0  AS "Min Price 0" AutoGenerate(1000000); Min_Price_Final: LOAD "Min Price 1" AS "Min Price"   Resident Min_Price;   Concatenate(Min_Price_Final) LOAD "Min Price 2" AS "Min Price"   Resident Min_Price;   Concatenate(Min_Price_Final) LOAD "Min Price 3" AS "Min Price"   Resident Min_Price;     Concatenate(Min_Price_Final) LOAD "Min Price 4" AS "Min Price"   Resident Min_Price;     Concatenate(Min_Price_Final) LOAD "Min Price 5" AS "Min Price"   Resident Min_Price;     Concatenate(Min_Price_Final) LOAD "Min Price 6" AS "Min Price"   Resident Min_Price;         Concatenate(Min_Price_Final) LOAD "Min Price 7" AS "Min Price"   Resident Min_Price;         Concatenate(Min_Price_Final) LOAD "Min Price 8" AS "Min Price"   Resident Min_Price;         Concatenate(Min_Price_Final) LOAD "Min Price 9" AS "Min Price"   Resident Min_Price;         Concatenate(Min_Price_Final) LOAD "Min Price 10" AS "Min Price"   Resident Min_Price;           Concatenate(Min_Price_Final) LOAD "Min Price 0" AS "Min Price"   Resident Min_Price;     Drop Table Min_Price;     Min_Price:   NoConcatenate load Distinct   ROUND("Min Price",'0.10') as "Min Price"   Resident Min_Price_Final;     Drop Tables Min_Price_Final;     Max_Price:   load "Min Price" as "Max Price"   resident Min_Price;    

1 Reply
cmorri1988
Creator
Creator
Author

Hi All,


I'm sure there is a very easy answer to this, but something I cant find. Currently trying to generate two min and max price fields with values between 0 and 1m with a step of 10p, for example 0,10p, 20p, 30p and so on. Does anyone have any examples of how best to achieve. Current script returns 0, 0.1, 0.2, 0.3 and can't seem to format correctly.


Thanks

--------

Min_Price:
LOAD
RecNo()-0.10 AS "Min Price 1",
    RecNo()-0.20 AS "Min Price 2",
    RecNo()-0.30 AS "Min Price 3",
    RecNo()-0.40 AS "Min Price 4",
    RecNo()-0.50 AS "Min Price 5",
    RecNo()-0.60 AS "Min Price 6",
    RecNo()-0.70 AS "Min Price 7",
    RecNo()-0.80 AS "Min Price 8",
    RecNo()-0.90 AS "Min Price 9",
    RecNo()-1   AS "Min Price 10",
    RecNo()-0   AS "Min Price 0"
AutoGenerate(1000000);


Min_Price_Final:
LOAD
"Min Price 1" AS "Min Price"
   Resident Min_Price;
  
Concatenate(Min_Price_Final)
LOAD
"Min Price 2" AS "Min Price"
   Resident Min_Price;
  
Concatenate(Min_Price_Final)
LOAD
"Min Price 3" AS "Min Price"
   Resident Min_Price;
  
   Concatenate(Min_Price_Final)
LOAD
"Min Price 4" AS "Min Price"
   Resident Min_Price;
  
   Concatenate(Min_Price_Final)
LOAD
"Min Price 5" AS "Min Price"
   Resident Min_Price;
  
   Concatenate(Min_Price_Final)
LOAD
"Min Price 6" AS "Min Price"
   Resident Min_Price;
  
      Concatenate(Min_Price_Final)
LOAD
"Min Price 7" AS "Min Price"
   Resident Min_Price;
  
      Concatenate(Min_Price_Final)
LOAD
"Min Price 8" AS "Min Price"
   Resident Min_Price;
  
      Concatenate(Min_Price_Final)
LOAD
"Min Price 9" AS "Min Price"
   Resident Min_Price;
  
      Concatenate(Min_Price_Final)
LOAD
"Min Price 10" AS "Min Price"
   Resident Min_Price;
  
  
      Concatenate(Min_Price_Final)
LOAD
"Min Price 0" AS "Min Price"
   Resident Min_Price;
  
   Drop Table Min_Price;
  
  Min_Price:
   NoConcatenate load Distinct
   ROUND("Min Price",'0.10') as "Min Price"
   Resident Min_Price_Final;
  
   Drop Tables Min_Price_Final;
  
  Max_Price:
  load "Min Price" as "Max Price"
  resident Min_Price;