Can we divide a column's data with another column's previous day data ?

Anshul Kashyap shared this question 1 week ago
Awaiting Reply

Hello,

I have a requirement to divide a column's record with another column's previous date data. Do we have any option to perform this. Please suggest.


Regards

Anshul

Comments (3)

photo
1

Hi Anshul,

Can you elaborate on how this would work? Typically dates are not stored in number format so are difficult to do math on top of.

The best route for this is to use our pre-defined functions or freehand such as DATEDIFF to first make this date a real number which you can then do math on. (eg: days since ___).

Regards,

Nathan

photo
1

Hi Nathan,

Just to elaborate I have two columns A and B which are coming from DB by date (like A contains some data for whole month and B contains some other data for whole month). Now I want a third column C which contains division of A by B's previous day data (For ex: C equals A data of 11th October/ B data of 10th October)

Please suggest me if this can be done through Yellowfin.


Thanks

Anshul

photo
1

Hi Anshul,

Typically the best way to do this is to create an append sub-query joining on whatever these two columns have in common.

In the first sub-query, filter the data down to todays date, and in the second, filter it down to be yesterdays date.

You can also do this with calculated fields.

Once you have columns representing each day, you can just do basic division using a third calculated field.

Let me know if this makes sense.

Regards,

Nathan