Hello,
I have the following data source CSV format:
Stat1,Stat2
raw,raw
:stat1Path,:stat2Path
10,5
20,10
30,15
40,20
50,25
I'm trying to add a 2x3 table:
\ | Stat1 | Stat2 |
Max | - | - |
Avg | - | - |
If I try to write in the table field the expression I want for max/average on a particular column, it doesn't work ( {Max(testing.Stat2)} ). However, if I define a data transformation in which I compute the max/average (using basically the same formula), I can correctly display the value.
Can you please let me know if there is a method I can do this directly without defining for each column a data transformation? I am suspecting the expression I am using is not correct, but I have not found in the documentation a section that explains this part.
I have attached the .mrt file I am using.
Thank you,
Vlad
Issue regarding aggregation function application on column
Issue regarding aggregation function application on column
- Attachments
-
- Testing.mrt
- (24.82 KiB) Downloaded 95 times
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Issue regarding aggregation function application on column
Hello,
You can use Totals.Max() and Totals.Avg() functions.
Thank you.
You can use Totals.Max() and Totals.Avg() functions.
Thank you.
- Attachments
-
- Testingmodified.mrt
- (15.65 KiB) Downloaded 104 times
Re: Issue regarding aggregation function application on column
Hello Lech,
Thank you very much for the answer. The Totals.Sum part works perfectly for what I need. However, I'm still having trouble with Totals.Avg as it displays "NaN" which I assume is caused by the fact what the columns also contains non-numeric values.
Would you be kind to also help me with a method to compute the average for just the numeric values. I see that there is a function AvgIf, but I've tried multiple conditions and unfortunately none of them has worked.
Best regards,
Vlad
Thank you very much for the answer. The Totals.Sum part works perfectly for what I need. However, I'm still having trouble with Totals.Avg as it displays "NaN" which I assume is caused by the fact what the columns also contains non-numeric values.
Would you be kind to also help me with a method to compute the average for just the numeric values. I see that there is a function AvgIf, but I've tried multiple conditions and unfortunately none of them has worked.
Best regards,
Vlad
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Issue regarding aggregation function application on column
Hello,
Your column contains as string and numeric values. Please check the following expression:
{Totals.Avg(testing, (TryParseDecimal(testing.Stat1) == false ? 0 : testing.Stat1 ))}
Thank you.
Your column contains as string and numeric values. Please check the following expression:
{Totals.Avg(testing, (TryParseDecimal(testing.Stat1) == false ? 0 : testing.Stat1 ))}
Thank you.
Re: Issue regarding aggregation function application on column
Hello Lech,
This has solved my problem! Thank you very much.
Vlad
This has solved my problem! Thank you very much.
Vlad
-
- Posts: 6245
- Joined: Tue Mar 20, 2018 5:34 am
Re: Issue regarding aggregation function application on column
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.