Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

populating values

Hi All,

This is my scenario. Please suggest.

basically avgprice is getting calculated by front end expression.. now after 12th month.. 13th to 18th month it should populate the same avgprice as 12 th month until 18th..

secondly these avgprice values should also gets populated from the 12th month avgprice for neutalprice and midstockprice from 13 to 18th

   

yearmonthpriceavgpriceneutalpricemidstockprice
2015183323,9166666723,9166666723,91666667
2015173323,9166666723,9166666723,91666667
2015163323,9166666723,9166666723,91666667
2015153323,9166666723,9166666723,91666667
2015143323,9166666723,9166666723,91666667
2015133323,9166666723,9166666723,91666667
2015123323,9166666723,9166666723,91666667
2015113123,090909092277
2015102222,3346
201593422,33333333225
201581120,875334
201574422,28571429115
201567718,66666667446
2015567777
2015457,258888
2015378997
2015288,54465
201519934

   

12 Replies
sunny_talwar

You were going to send me this in an email or something bigger? Front end solution would work?

raadwiptec
Creator II
Creator II
Author

hi sunny yes I am trying to cover this on the script..probably a bigger note.to your email. but in the mean time can u suggest here as well

sunny_talwar

I cannot send you a message until you follow me, so either follow me or send me IM since I have already followed you

raadwiptec
Creator II
Creator II
Author

hi sunny iam trying to find the option to send you a message ..I don't find anywhere in the website

sunny_talwar

This is one solution in the script, but this requires order by statement:

Table:

LOAD year,

    month,

    price

//    avgprice,

//    neutalprice,

//    midstockprice

FROM

[https://community.qlik.com/thread/191475]

(html, codepage is 1252, embedded labels, table is @1);

NewTable:

NoConcatenate

LOAD year as Year,

    month as Month,

    price as Price,

//    [average Price] as [Average Price],

    If(month <= 12,

    If(Peek('Year', -12) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7), Peek('Price', -8),

      Peek('Price', -9), Peek('Price', -10), Peek('Price', -11), Peek('Price', -12)),

    If(Peek('Year', -11) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7), Peek('Price', -8),

      Peek('Price', -9), Peek('Price', -10), Peek('Price', -11)),

    If(Peek('Year', -10) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7), Peek('Price', -8),

      Peek('Price', -9), Peek('Price', -10)),

    If(Peek('Year', -9) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7), Peek('Price', -8),

      Peek('Price', -9)),

    If(Peek('Year', -8) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7), Peek('Price', -8)),

    If(Peek('Year', -7) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6), Peek('Price', -7)),

    If(Peek('Year', -6) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5), Peek('Price', -6)),

    If(Peek('Year', -5) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4),

      Peek('Price', -5)),

    If(Peek('Year', -4) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3), Peek('Price', -4)),

    If(Peek('Year', -3) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2), Peek('Price', -3)),

    If(Peek('Year', -2) = year,

    RangeAvg(price, Peek('Price', -1), Peek('Price', -2)),

    If(Peek('Year', -1) = year,

    RangeAvg(price, Peek('Price', -1)), price)))))))))))),

    Peek('Average Price')) as [Average Price]

Resident Table

Order By year, month;

DROP Table Table;


Capture.PNG

raadwiptec
Creator II
Creator II
Author

hi sunny , I have added u as connection and following you. but not able to send you  a message. if I try to send a message to you..it does not allow me ..anything am I missing here?

sunny_talwar

No you are doing it right. I added my email to this post and you should have got it in your email. Can you see it?

raadwiptec
Creator II
Creator II
Author

I just received this email as Sunny T approved you as a connection

but I do not find any other info..ur email id etc.. even the qlikview inbox nothing exists

raadwiptec
Creator II
Creator II
Author

Is their any front end solutions