How to Calculate a Day and Today?

Hi All,

 

I want to calculate day and today, How Board handle this case?

image

 

image

Tagged:

Answers

  • Helmut Heimann
    Helmut Heimann Employee, Community Captain
    500 Comments 250 Likes Fourth Anniversary 25 Answers

    Hi Wahyu Nugraha,

     

    did you already look here: How can I calculate difference between two dates? 

     

    Kind Regards,

    Helmut

  • Previous Member
    edited March 2020

    Hi,

     

    That is different, i want dataview show like this

    image

     

    if day < today i want to get data from cube actual packing else aggr planning. but it shown wrong.

    and my layout like this

    image

     

    are "Day" as entity cannot compare with "Today" as cube?

  • Helmut Heimann
    Helmut Heimann Employee, Community Captain
    500 Comments 250 Likes Fourth Anniversary 25 Answers

    Hi Wahyu,

     

    it doesn't seem as if your cube "Actual Packing" contains any data--at least the dataview doesn't show anything...

    Do you have actual figures for "today()"?

    The column "Day" (the entity) is set to display in what way (Code/Desc/Code&Desc)?

     

    Kind Regards,

    Helmut

  • Björn Reuber
    Björn Reuber Employee, Community Captain
    500 Likes Fourth Anniversary 100 Comments 5 Answers

    Hi,

     

    Entity "Day" is a string (like every other Entity), so comparing it with a date doestn lead to a result. But you can create a date cube (based on Day) which contains the date, or you can use nexel for transforming the Day-String to a Day-Date

     

    regards

    Björn

  • Previous Member
    edited March 2020

    Hi Wahyu Nugraha,

     

    In your latest screenshot is "today" a cube. In the first one "today()" was an algorithm. As seen here Column Algorithm

    image

     

    BR, Ray

  • HI Helmut Heimann

     

    The dataview should be shown aggr planning.

    "Today" is Cube date which is run by procedure. its like today().

    "Day" as entity is set display by Code.

  • Previous Member
    edited March 2020

    It shown when i change "day" as code and today as column algorithm is running, but logical its wrong.

    exmple: 24/08/2018 compare 25/07/2018, board shown actual packing.

    it should be on logical if(d<e,c,b) must show aggr planning. because d<e is false.

    image

  • Previous Member
    edited March 2020

    Hi Ray Martens

     

    Thanks for your correction. now dataview is shown but its wrong.

    image

  • Previous Member
    edited March 2020

    HI,

     

    I also try create date cube with contains the date with running procedure. but it shown blank.

    imageimage

  • Miguel Angel Sisternas Seaton
    edited March 2020

    You can create a cube that contains a number per day within your dates (i call it counter cube), this can be fairly easy to do with NEXEL writeback fuction in a process, Then by adding or subtracting you can always move forward or backwards from that counter. At the same time it allows to have comparisons, if (Date = date where i am ; counter ; 0). Giving me when there is a match within dates. In the example below i have found out that my start date corresponds to counter 146. If i add 2 days, i go to 148 which would be the 25.07.18 2 days more than the 23.07.18.

    Cool thing about this solution, you can modify the nexel (as in my example) at will and include for example working days, holidays, or other calendar specific things you with to do. This will modify the counter allowing you to move 2 working days forward for example.

     

    image

     

    image

  • *you wish to do