Forum Discussion
jaws2k
6 years agoFrequent Visitor
Calculated Dynamic Table with multiple columns
Hi, I am wondering if it is possible to create a dynamic table with multiple columns. I am looking to generate a table for historical data view ranges, a mix of static values and previous yea...
- 6 years ago
Hi,
I think I got this code to work:
Historical data = VAR _minYear = MIN ( vDate[Year] ) RETURN UNION ( DATATABLE ( "HistoricalData"; STRING; "Sort"; INTEGER; { { "1M"; 1 }; { "3M"; 2 }; { "6M"; 3 }; { "9M"; 4 }; { "12M"; 5 } } ); ADDCOLUMNS ( DISTINCT ( vDate[Year] ); "Sort"; vDate[Year] - _minYear + 6 ) )Cheers,
S
sturlaws
6 years agoResident Rockstar
Hi,
I think I got this code to work:
Historical data =
VAR _minYear =
MIN ( vDate[Year] )
RETURN
UNION (
DATATABLE (
"HistoricalData"; STRING;
"Sort"; INTEGER;
{
{ "1M"; 1 };
{ "3M"; 2 };
{ "6M"; 3 };
{ "9M"; 4 };
{ "12M"; 5 }
}
);
ADDCOLUMNS ( DISTINCT ( vDate[Year] ); "Sort"; vDate[Year] - _minYear + 6 )
)Cheers,
S