Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculated dimension.

Hi All,

we have created a straight table with one dimension called month and 8 expressions.

requirement was to display only one month in the table.

so we selected Max Number (1-100) to 1 in the presentation tab. by default it displays only Jan when no selection is made on month. when clicked on different months it changes accordingly.

but the user wants to see the previous month values by default.. which should be December when i see in January.

so i tried modifying the dimension with the help of calculated dimension. its not giving expected results when no selection is made on month.

below is the calculated dimension.

=if(GetSelectedCount(Month)=0,Month(AddMonths(MonthStart(Today()),-1))),Month)

please help. any suggestions appreciated.

Thanks

Jyothi

1 Solution

Accepted Solutions
morganaaron
Specialist
Specialist

I don't think you want a calculated dimension here - instead try using set analysis on your expression(s), like:

=if(GetSelectedCount(Month)=0, Sum({<Month={"$(=Month(AddMonths(MonthStart(Today()),-1)))"}>}Value), Sum(Value))

I've attached your example here.

Aaron

View solution in original post

5 Replies
Anonymous
Not applicable
Author

Could you post some sample?

morganaaron
Specialist
Specialist

That expression seems to work for me fine, the only difference I can see is you have an extra bracket after the Today()), -1))) statement - there should only be two brackets needed at the end, not 3.

If that's just a typo, maybe worth posting an example!

Not applicable
Author

Hi Aaron.. sorry that was a typo.. i Have attached a sample.. please check..

morganaaron
Specialist
Specialist

I don't think you want a calculated dimension here - instead try using set analysis on your expression(s), like:

=if(GetSelectedCount(Month)=0, Sum({<Month={"$(=Month(AddMonths(MonthStart(Today()),-1)))"}>}Value), Sum(Value))

I've attached your example here.

Aaron

Not applicable
Author

Thanks Aaron.. Issue resolved