Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
zahidrahim_ocp
Contributor

Quantity and rate from different periods

Dear Experts,

I have two tables one with quantities and one with rates, period and item wise. joined through composite key item+period. Now

Sum(quantity*rate) is giving perfect result for selected period.

I want if the selected periods dont have rates then it should pick rates from the previous period.

Regards

Zahid Rahim

5 Replies
galax_allu
Valued Contributor

Re: Quantity and rate from different periods

I am just providing an idea ..

Expression 1 :Sum(quantity*rate)




Expression 2 :sum(quantity*Alt(rate,1)


or

Expression 2 :sum(quantity*Alt(rate,Previous(Period))

pradosh_thakur
Honored Contributor II

Re: Quantity and rate from different periods

Hi

1:do you use period in the table ?

please attach a sample to work on ..

Learning never stops.
zahidrahim_ocp
Contributor

Re: Quantity and rate from different periods

How the Previous(Period) get identified ?

zahidrahim_ocp
Contributor

Re: Quantity and rate from different periods

Yes Periods exist in the table. only current period don't have any data but rates exist.

Re: Quantity and rate from different periods

It's a missing data scenario...I would suggest you to start populating the  missing data in the back end ...check this post

Generating the missing data with previous data

Community Browser