Quick-switching column types, between Real & Virtual

Sometimes you want to switch a real column to a virtual column, or vice-versa.

I’ve noticed that if you have a VC, and you add a real column with the same name, upon regeneration the VC is gone, and all the column definitions (initial value, formula, etc) have been transferred to the new real column. That is very handy!

I’m not seeing any way to do such an easy transfer going the other way though, from real to virtual. Any tips?

1 Like

Hey Marc.

I posted in the older community a few years ago about this (giving the team kudos). :slight_smile:
Praveen came back with something like: we didn’t code that, it just happened that things worked out that way. lol

It would be nice to be able to say, make this a virtual column; because going from having a physical to a virtual column means you need to go through and configure the virtual the same as the physical.

Maybe a way to copy the definition from one column to another?

2 Likes

Haha, that’s interesting.

1 Like

Sorry for the very basic question but why would one want to switch between a real and a virtual column? I’ve used virtual columns to modify how data in real columns is displayed (and then I display the virtual column, not the real one) but I can’t imagine what you are referring to here.

Real column formulas only update when a record is directly edited. Virtual columns always update. So they are better in some cases. But if you have an app with a lot of data and a lot of virtual columns it will be significantly slower. So I try to only use virtual when necessary. Sometimes my initial plan doesn’t work and it needs to change, or requirements change.

There are other reasons too.

4 Likes

Thanks for your help, @Marc_Dillon!

I’m quite interested in improving the performance of my app so, despite being a bit embarrassed about not fully understanding this discussion, I think I should admit that I’m still a bit confused.

Let’s say I have some raw data in my spreadsheet that is 0.3843. That comes into my app via a real column. Then, if I want to display it as 38%, I use a virtual column with an expression that does the work I need to have do.

Is it possible to do this all in one real column? Sorry to be so dense but if you could give me an actual example, I’d really appreciate it. I’m having trouble understanding when a real column and a virtual column could be consolidated into one real column.

1 Like

You should be able to just set the type of the column to percent and it should display correctly, in your example.

For a practical example, consider a medical database app I’ve got for a client of mine. Over the years we’ve accumulated so many records, but in the beginning there wasn’t any - fresh g-sheet - so the formulas we used to create sums, percents, rates of increase, etc. were all simple virtual columns.

But eventually, as the record count grew, these formulas caused major slow downs.

To combat this, instead of using virtual columns, I moved the variable into the Patient table as a physical column, Then I used a set of actions to update that value strategically, this way it always had the most recent data - but we didn’t need to calculate it all the time.

2 Likes

Thanks! The part about making the column a percentage column is simple enough. I should have known about that.

Now I think I see what you mean about changing virtual columns to real ones. I do something similar in the main app I’m working on.

Thanks again!

2 Likes