Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

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
Valued Contributor

Re: calculated dimension.

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

5 Replies
satyadev_j
Valued Contributor

Re: calculated dimension.

Could you post some sample?

morganaaron
Valued Contributor

Re: calculated dimension.

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

Re: calculated dimension.

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

morganaaron
Valued Contributor

Re: calculated dimension.

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

Re: calculated dimension.

Thanks Aaron.. Issue resolved