I can't seem to understand how timestamps are represented internally in visual overviews. I'm trying to use datetime and timestamp values but I don't really find it intuitive.
I have a parameter containing a timestamp and I want to see if this time has passed or not use that boolean as a conditional to show or hide a shape. Nothing happens when using
<A>-A|127701/259|307:[tableindex]|>[DataMinerTime]
When adding a text shape with the placeholder
[Subtract:[Param:127701/259,307,[tableindex]],[DataMinerTime]]this shows correctly. For example if the time has passed it shows -01:00:00. However when trying to do
<A>-A|Value|[Subtract:[Param:127701/259,307,[tableindex]],[DataMinerTime]]|>0
or
<A>-A|Value|[Subtract:[Param:127701/259,307,[tableindex]],[DataMinerTime]]|Regex=^[\d:]+
neither works.
I tried setting it up locally and it works as expected here with your final example. Your regex matches everything that contains ONLY a number or ':', meaning that if you use it as a Hide condition it will NOT SHOW all the positive timespans.
An even simpler regex for this would just be "-" though. If I set this as my Hide shape data, all positive results are hidden:
<A>-A|Value|[Subtract:[DataMinerTime],[Param:Data Insights,820,[tableindex]]]|Regex=-
If you are still encountering issues, feel free to reach out for some further investigation (maybe with sharing a dmimport package and your DMA version?).
Thanks. Overlooked that part. But the regex comparison and the subtract in the extended condition definitely do work.
Indeed, although using a regular expression is less straight forward for this use case.
Good catch with the separator and the simpler regex! What seemed to be missing (not really sure why) was adding the shape data fields View: [this view] and Enabled: False.
Hi Robin,
Great use case! Unfortunately, the extended shape manipulations do not support comparing datetime values (yet). So this is currently the expected behavior. However I do believe this is a nice use case.
Feel free to create a feature suggestion here and/or create a new feature request in your M&S project.
While DateTime comparisons are not supported by the condition logic, I believe the last example Robin gives is a configuration issue? It uses the placeholder that worked and uses it as a value for a regex comparison. Let’s take some time to take a look at that one? Likely the [TableIndex] is not getting resolved correctly? This could easily be checked by doing a condition with ONLY the [TableIndex]
@Robin, @Toon, the second example is probably failing on the minus (dash) character since that’s used to separate the different parts of an extended condition. Please try replacing the dash character with something else using the [Sep:XY] syntax.
The dash is used as a separator for multiple parts of your condition, you’ll need to change it using the [Sep:XY] syntax in order for this to work.