Skip to main content
Announcements
Customer Spotlight: Discover what’s possible with embedded analytics Oct. 16 at 10:00 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
subin6600
Creator III
Creator III

How to use a calculated value within an expression?

Hi Qlikviewers!

I know it sounds little confusing so I will explain you with an example.

I have the below fields,

SupplierNamePO YearPO MonthPriceChangexBudgetedVolumePriceChangeBase Value
A2012JanPriceChange125000000.02212500.00
A2012FebPriceChange225000000212500.00
A2012MarPriceChange325000000212500.00
A2012AprPriceChange425000000.015215687.50
A2012MayPriceChange525000000215687.50
A2012JunPriceChange625000000215687.50
A2012JulPriceChange725000000215687.50
A2012AugPriceChange825000000.015218922.81
A2012SepPriceChange925000000218922.81

The base value is a calculated field i.e.,

Jan: BudgetedVolume/12+(BudgetedVolume/12*PriceChange)

Feb: BaseValue(Jan)+BaseValue(Jan)*PriceChange

Mar: BaseValue(Feb)+BaseValue(Feb)*PriceChange... and so on.

How can I achieve it? The data cannot be expected to be in order, So I need to be fool proof. How can i calculate this?

Regards,

Subin Thomas

4 Replies
Gysbert_Wassenaar

Why can't the data be expected to be ordered? You can force that on load with an order by clause afaik.


talk is cheap, supply exceeds demand
subin6600
Creator III
Creator III
Author

Yes, orderby I can use but. Is there any other method with which I can do this without even ordering?

Gysbert_Wassenaar

Concatenate Year and the number of the Month (201201, 201202 etc) as a calculated dimension and sort on that should work I think. But fixing it in the load script is much easier imho.


talk is cheap, supply exceeds demand
subin6600
Creator III
Creator III
Author

Ok Gwassenaar, The ordering part is fine. But how to calculate the BaseValue? as I require?

SupplierNamePO YearPO MonthPriceChangexBudgetedVolumePriceChangeBase Value
A2012JanPriceChange125000000.02212500.00
A2012FebPriceChange225000000212500.00
A2012MarPriceChange325000000212500.00
A2012AprPriceChange425000000.015215687.50
A2012MayPriceChange525000000215687.50
A2012JunPriceChange625000000215687.50
A2012JulPriceChange725000000215687.50
A2012AugPriceChange825000000.015218922.81
A2012SepPriceChange925000000218922.81