DataGraph Forums › Technical Support › Support Desk › Defining text variable with regex
Hi,
I was wondering if there is anyway that I can define text variable with regex (wildcard *, specifically). Some of my graphs have different components, for example, histogram and some statistics using box command. I use my flattened data along with masks to plot the appropriate portion of data. Right now, I have two Drawing groups (one for my histograms, and one for my statistics and Box command) and I have masked each of these groups individually. It would be very convenient (and less prone to mistake) if I can masked them both with one global variable. The reason that I cannot put everything into one Drawing group is that the column that is being used for masking is different between the two groups.
In terms of the variables, there is not currently a way to include a wildcard. Although, wildcards can be used in a mask defined using a command. One thing that might help is that you can use the commands, such as the Points command to generate a column based on more complex expressions.
Here is an example to illustrate.
1 – Add a Points command with the x as the row number and leave the y as specified.
2 – Add Mask conditions using wildcards as needed. In my example, I wanted all rows returned where it the text begins with ‘A’ or ends in ‘1’.
3 – Click the gear menu on the Points command and select Extract as Column >Mask.
This creates a number column of 1 and 0, where 1 means the value satisfied the conditions (outlined here in red).

You don’t even have to draw the result of the command but just use this as a way to create more complicated mask statements. Then the extracted column, containing 1 or 0, is used in other commands where you want to draw the data or perform other calculations.
Again I am not sure if this is getting at your question but this is a way to create a more complicated mask and have it represented in a single column.
Hi,
Thank you for your answer. While it is not what I am looking for, it is a nice trick and might come handy. Thanks for sharing it.
Regarding the original question, I am currently using wildcards in mask defined in both commands (histogram and box) but I am looking for away to use it once (for a group containing the two). The reason that I cannot do it right now is the masks are being applied on two different columns (although the text is the same).
Please see the attached screenshots for clarification.
Best,
Kourosh


Thanks for clarifying.
There is not a way to currently combine a wildcard with a variable. This is something we will work on for the next version!
Great, thanks for your hard work.
Kourosh
DataGraph Forums › Technical Support › Support Desk › Defining text variable with regex