Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Date problem

I have a table called "WHUIL200" and there is a date field present "T$INDT".

I have to filter this table based on the dimension "T$INDT"=last month end date.

Load
Company_Code,
"T$ITEM" & '|' & Company_Code as [Temp_Key_Item],
"T$ITEM" as [Item],
"T$CWAR" as [Warehouse],
"T$QNTY" as [Quantity],
"T$AMNT" as [Value],
Date("T$INDT",'DD-MM-YYYY') as "T$INDT",
'WHUIL200' as [Table Source]


FROM [$(vSource)\TWHUIL200.qvd](qvd);
 where ("T$INDT" = '$(vLastmonthdate)');

but everything comes blank, when I remove the where condition it shows all the data(unfiltered).

This is my variable let vLastmonthdate =date(floor(monthend(addmonths(Today(),-1))));

This variable works perfect for all other tables.

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Your date format is possibly not matching with the variable value format. You can avoid this by using num() in both date and variable like:

where num(Floor("T$INDT")) = num($(vLastmonthdate));

View solution in original post

2 Replies
Or
MVP
MVP

I'd suggest running the script step by step using debug mode and seeing what actual comparison is made (that is, what the exact variable value is). You can then cross-check that with the actual value in the table and see if they match or not.

You could also just load this value as a field in your table and then check if that matches up:

Load
Company_Code,
"T$ITEM" & '|' & Company_Code as [Temp_Key_Item],
"T$ITEM" as [Item],
"T$CWAR" as [Warehouse],
"T$QNTY" as [Quantity],
"T$AMNT" as [Value],
Date("T$INDT",'DD-MM-YYYY') as "T$INDT",

'$(vLastmonthdate)' as TestDate,
'WHUIL200' as [Table Source]


FROM [$(vSource)\TWHUIL200.qvd](qvd);

tresesco
MVP
MVP

Your date format is possibly not matching with the variable value format. You can avoid this by using num() in both date and variable like:

where num(Floor("T$INDT")) = num($(vLastmonthdate));