Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Luke_Killer_IT
Creator
Creator

probelm date

Hi 

I have a date problem and I want to see the date >= from today's date and I see this 

Luke_Killer_IT_0-1629452141246.png

 

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))))

1 Solution

Accepted Solutions
Vegar
MVP
MVP

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.

Vegar_0-1629459401020.png

 

View solution in original post

5 Replies
Vegar
MVP
MVP

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

Luke_Killer_IT
Creator
Creator
Author

@Vegar  in fact, I am not hiding anything but the fact that I do not want to see data that is past like this 

Luke_Killer_IT_1-1629453840920.png

 

 

Luke_Killer_IT
Creator
Creator
Author

How can I hide this data because the if formula doesn't work?

Vegar
MVP
MVP

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.

Vegar_0-1629459401020.png

 

Luke_Killer_IT
Creator
Creator
Author

thank you for your help