Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have a requirement for using a vizlib table to create an indicator based on month to month comparison
So there are two date fields, the actual_date that consists of the past two months, 09/20 and 08/20. Each month a new month is added but for now we only have these two months. Then we have manufactured date for the products. So we need to make make a table for products and their manufactured date, one based on latest actual_date and one based on prev actual_date. So the table for the previous actual_date would be like:
Product | Manufactured Date |
A | 4/16/18 |
B | 2/5/17 |
C | 3/14/16 |
and the table for the current actual_date would be like:
Product | Manufactured Date |
A | 1/16/15 |
B | 5/9/18 |
C | 3/14/16 |
So the table below would be the manufactured date of products based on previous vs current actual_date field. We are needing to create a indicator, just a background color on CURR to compare whether the manufactured date for a product in the current actual_date is sooner or later than the manufactured date the previous actual date
Product | Manufactured Date (PREV) | Manufactured Date (CURR) |
A | 4/16/18 | 1/16/15 |
B | 2/5/17 | 5/9/18 |
C | 3/14/16 | 3/14/16 |
However, the expression i've tried to use isn't working, I am only getting white background color. I had created two variables vCurrentMonth (max(actual_date)) for the current actual_date and vPreviousMonth (=Date(Monthstart(Date(Date#(Max(actual_date),'MM-YYYY'),'MM-YYYY'))-1,'MM/YY'))
for the previous actual_date and had created this expression:
if(only({<Actual_date={$(vCurrentMonth)}>}Manufactured_Date) > only({<Actual_Date={$(vPreviousMonth)}>}Manufactured_Date), Green(),
if(only({<Actual_date={$(vCurrentMonth)}>}Manufactured_Date) < only({<Actual_Date={$(vPreviousMonth)}>}Manufactured_Date), Red(), White()))
As mentioned I am only getting white background cells when that shouldn't be the case. What am I doing wrong?
Did not understood completely !! Could you share the full sample data set ? and is your data is getting overwritten every month ? if yes where your storing the previous months data
Hello @avinashelite , Here is the sample report. Let me know of any issues
And data is not being overwritten every month
I haven't got a chance to check, currently I'm outside. Will revert once I get a chance to check
check the attachment for the solution
Hi @avinashelite ,
Thanks a lot for the help! I had tried what you had done, and inserted an extra condition, using the word 'same' for when the dates are equal. However, for some reason the indicator is displaying 'same' for all the values. In my data, there is at least one - two values that differ from previous month to current month, but even for those values the indicator is showing 'same'. Is there a reason for this?
Could you share your expression?