Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a date problem and I want to see the date >= from today's date and I see this
my scipt :if((Kalender<=week(Today())&'-'& Year(Today())),
if((sum(details)-(((num(WeekDay(Today())))/5)*sum(details)))<0,'0',
sum(details)-(((num(WeekDay(Today())))/5)*sum(details))
),if(Kalender<week(Today())&'-'& Year(Today()),'0',if(Kalender>week(Today())&'-'& Year(Today()),sum(details))))
I believe the main issue for you comparing the Week-Year field with today is that it does not hold a date value. I would probably have tried to convert the string into a dual like in my script below.
LOAD
dual([YearWeek], makeweekdate( SubField([YearWeek], '-', 1 ),SubField([YearWeek], '-',2 ))) as [YearWeek], //Creating a dual of the YearWeek field.
Value
FROM MySource;
By having a numeric date value you can compare it to today() in a set analysis. In the chart below I used this expression: SUM({<YearWeek={">=$(=today())"}>}Value) You will need to modify the SUM(Value) to your data model and expression.
It feels like you are witholding some information in order for us to understand your issue.
Is it possible for you to explain your issue in other words or provide a small set of sample data and a description of the desired output of that sample.
BR Vegar
@Vegar in fact, I am not hiding anything but the fact that I do not want to see data that is past like this
How can I hide this data because the if formula doesn't work?
I believe the main issue for you comparing the Week-Year field with today is that it does not hold a date value. I would probably have tried to convert the string into a dual like in my script below.
LOAD
dual([YearWeek], makeweekdate( SubField([YearWeek], '-', 1 ),SubField([YearWeek], '-',2 ))) as [YearWeek], //Creating a dual of the YearWeek field.
Value
FROM MySource;
By having a numeric date value you can compare it to today() in a set analysis. In the chart below I used this expression: SUM({<YearWeek={">=$(=today())"}>}Value) You will need to modify the SUM(Value) to your data model and expression.
thank you for your help