Calculate/derived columns in a datagrid.

david.wueste shared this question 6 years ago
Answered

How do I configure/setup a table/data grid interactive mockup where :


>> if Col A = Value1


>> and Col B = Value2


I can have a Col C in my datagrid where the expression:


[ CONCAT ([ CONCAT( Col A, '~')], Col B ) ]


Results in Col C = Value1~Value2


Is this possible in JustinMind?

Comments (5)

photo
1

Sure it is. Create an on page load event on any of the texts inside the data grid. Then add an interaction like this:


set value -> Col C -> value is -> [Value 1 concat ['~' concat Value 2]]

photo
1

Yes - I figured this one out...


On Page Load (for Row_Detail)


Set Value = select(Row_Detail,ColA) concat '-') concat select (Row_Detail,ColB)

photo
1

You're right! I forgot the function select.

photo
1

I felt pretty victorious - then I had another event that "filtered" this datagrid to simulate a Search on the view and then the calculated/derived columns went blank.


How do I address that?

photo
1

Ummm I think that should be easy but it isn't. I think you need to refresh the screen in order to make the on page load event work. But then you'll loose the result of the filter. So what I'd do is to save the result of the filter in a variable and then define another on page load event that sets the value of the data grid with the value in the variable. And then link to the same screen to refresh the values.