04-14-2023 03:02 AM
Can we create a column which calculates minimum of 2 same columns but with different filter?
Consider Column_1 is having a filter Filter_1 and Column_2 is having a filter Filter_2, here both the columns are same but filters are different. Also filters are coming from Presentation Variables.
Solved! Go to Solution.
04-14-2023 05:41 AM
Hi,
It is possible using min function and bring those 2 presentation variable filter based columns into formula builder itself.
For eg. using case formula you can apply the presentation variable based filter in the condition and bring the column1 and
similarly using another case formula you can apply the presentation variable based filter in the condition and bring the column2.
By applying min function for these 2 columns created in formula builder, you can get the desired result.
Scenario:
Eg:$PeriodName is Presentation variable in 'MM-YY' format i.e. '12-22' for Dec 2022
min(
sum(
case(
Test.psr_base_cost.period_name = $PeriodName,
sum(
Test.psr_base_cost.amount
),
0
)
),
sum(
case(
int(
'20' + substring(
$PeriodName,
find(
'-',
$PeriodName
) + 1
)
) = Test.psr_base_cost.period_year,
sum(
Test.psr_base_cost.amount
),
0
)
)
)
Above scenario, column1 is showing data for chosen 'Period Name' and Column2 is showing data for the 'year' wise.
'Test' is the schema name and 'psr_base_cost' is table name in above scenario.
Thanks
Venkatesh
04-17-2023 02:47 AM
Hi Venkatesh, Thank you so much!!
04-14-2023 08:07 AM
What type of visualization are you wanting to use?
04-17-2023 02:48 AM
I want to achieve this scenario under Aggregated Table!!