Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting a calculated dimension selects more than I want.

I have a table with a calculated diminsion.  When I click on the diminsion of one record, it selects all the months and other fields that are used in the calculated dimension.  The calcualted dimension is an if statement that when true gives the value of a field. 

=if((BLMonth1<=CurrentDocumentMonth3 or BLYear<"CurrentDocumentYear" or BLMonth=0) and BLYear<="CurrentDocumentYear",GL_Account_Number_Name_Balance_Sheet3)

When I click in the table, I only want the GL_Account_Number_Name_Balance_Sheet3 to be selected.  Is there away to do this?

1 Solution

Accepted Solutions
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Firstly, if this calculated dimension is not dependent upon user selections then put it in the script and create a new dimension.  Problem solved.

If this is not possible then you could maybe set up a couple of triggers to select possible "GL_Account_Number_Name_Balance_Sheet3" then clear the selections in the other fields.

Hope this helps,

Jason

View solution in original post

12 Replies
Jason_Michaelides
Luminary Alumni
Luminary Alumni

Firstly, if this calculated dimension is not dependent upon user selections then put it in the script and create a new dimension.  Problem solved.

If this is not possible then you could maybe set up a couple of triggers to select possible "GL_Account_Number_Name_Balance_Sheet3" then clear the selections in the other fields.

Hope this helps,

Jason

Not applicable
Author

Thanks Jason, what exactly do you mean by triggers?  Do you mean tie the selection of field to a variable value?  Could you elaborate an example of what I might do to accomplish this?

Not applicable
Author

Saddly, the dimension does require user selections so it can't be laoded in the script.

Jason_Michaelides
Luminary Alumni
Luminary Alumni

I think clicking on a value in this calculated dimension makes selections in BLMonth1 as well as other fields, right?  Go to Document Properties > Triggers and set some OnChange or OnSelection actions for BLMonth1:

1. Select Possible - GL_Account_Number_Name_Balance_Sheet3

2. Select In Field - BLMonth1 - <leave expression blank>

Hope this helps,

Jason

Not applicable
Author

That seems to work Jason, but I don't want de-select the current selections for the months and years.  What action would I use for that?

vgutkovsky
Master II
Master II

Brandon,

This is a very complex calculated dimension. I would advise that you take this logic out of the dimension and into set analysis. The dimension would then just be GL_Account_Number_Name_Balance_Sheet3.

Regards,

Vlad

Not applicable
Author

The expression is here: 

sum({ $<  balcode3={'ACTUAL'},

//LinkYear={$(=Only("CurrentDocumentYear"))},

//LinkMonth=CurrentDocumentMonth3,

[code3]={'RBIACCT'}

             >}Tot3)

Can you think of how I would add the cacluated dimension components to this expression?

vgutkovsky
Master II
Master II

I wrote this in Notepad so I'm not positive it will work (you might need to add or delete a few single quotes or something). But this should be the general idea:

sum({<balcode3={'ACTUAL'},[code3]={'RBIACCT'},BLYear={"<='$(CurrentDocumentYear)'"}>*(<BLMonth1={"<='$(CurrentDocumentMonth3)'"}>+<BLYear={"<'$(CurrentDocumentYear)'"}>+<BLMonth={0}>)} Tot3)

The dimension would just be GL_Account_Number_Name_Balance_Sheet3

Regards,

Vlad

Not applicable
Author

Very close Glad.  Just have to take out the single quotes. 

Only problem then is that it gives a value that static and doesn't change wirh CurrentDocumentMonth3 or CurrentDocumentYear selections.