Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Expression Question

Hi,

I have the attached Straight table.

Dimensions = trade_dt and period_cd_my

Expression = Sum(pos_lots)

Is there a way to show the sum of the position lots where the trade_dt is less than or equal to the dimension trade_dt?

ie Sum({<trade_dt={'<=trade_dt'}>}pos_lots)

Any help will be much appreicated.

Regards,

Daniel

12 Replies
richnorris
Creator II
Creator II

What do you mean by "where the trade_dt is less than or equal to the dimension trade_dt?" do you mean, where the dimension trade_dt is less than or equal to the summation of all trade_dt's for one period_cd_my?

Kushal_Chawda

did not understand this line "where the trade_dt is less than or equal to the dimension trade_dt"

danielnevitt
Creator
Creator
Author

Hi Richard,

Thank you for the reply.

I believe I do mean where the dimension trade_dt is less than or equal to the summation of all trade_dt's for one period_cd_my.

Regards,

Daniel

PabloOrtiz
Partner - Creator
Partner - Creator

Hi, can you upload an example that the result of the table you are find?

danielnevitt
Creator
Creator
Author

Hi Pablo,

Attached is some test data.

The column in red is what I am trying to produce.  This is the sum total of all the days data less than the trade_dt in that row.

I hope this makes sense.

Regards,

Daniel

Kushal_Chawda

see this

Data:
LOAD ProductName,
trade_dt,
period_cd_my,
[Sum(pos_lots)] as pos_lots
FROM

(
ooxml, embedded labels, table is Sheet1);

New:
NoConcatenate
LOAD *,
if(period_cd_my=Previous(period_cd_my),RangeSum(peek('Output'),pos_lots),pos_lots) as Output
Resident Data
Order by ProductName,period_cd_my,trade_dt;

DROP Table Data;

PabloOrtiz
Partner - Creator
Partner - Creator

!Hi, i atached an .qvw

danielnevitt
Creator
Creator
Author

Thanks for your response Kushal.

Is it possible to write this as an expression within the straight table?

Regards,

Daniel

Kushal_Chawda

i think pablo.ortiz already answered