Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Straight Table

Hi, Please find the attached Qvw file.

I have a dimension "Year",In the Expression tab i have multiple Expressions.

When i click on 2005 it has to be display 2001 to 2005 years data

when i click on 2006 it has to be display 2002 to 2006 years data.the condition should be given in Calculated dimension only.

I have added sample file.Please help me to do.

Thanks

1 Solution

Accepted Solutions
pho3nix90
Creator II
Creator II

Is there any specific reason why this has to be done in dimension? This is not possible as far as I know to overwrite selections (IE set analysis) in dimensions, this will have to be done in expression.

Please see attached.

View solution in original post

12 Replies
sasiparupudi1
Master III
Master III

=ValueLoop(Year-5,Year,1)

bhavvibudagam
Creator II
Creator II
Author

Thanks for reply but not working

Anonymous
Not applicable

you can use your calculated Dimension, but you must define in Expression [<Year=>}

otherwise you will only get 1 year

alternatively you can try this Expression:

=Sum({<Year={'>=$(=max(Year-4))<=max(Year)'}>}[Claim Value])

tresesco
MVP
MVP

Bhavvi b wrote:

....the condition should be given in Calculated dimension only.

Why so? Do you have a specific reason for that? Why not in the expression itself?

varshavig12
Specialist
Specialist

Try this.

sum({<Year={"<=$(=max(Year)) >$(=AddYears(max(Year),-4))"} >} Sale_Amount)

sasiparupudi1
Master III
Master III

Check this attachement.. It needs Year Selection

sasikanth
Master
Master

HI,

You will always get only one value if you select in Listbox,

as an alternative you can get the same if you select the year through Slider

PFA

Thanks

sasi

florentina_doga
Partner - Creator III
Partner - Creator III

or use

sum({

    $

    <Year=e({<Year=({'$(=$(vEnd+1))'})>} Year)>

    

    }

     [Claim Value])

bhavvibudagam
Creator II
Creator II
Author

Hi sasidhar,

If we select the year it is showing last five years.But it is showing error in calculated dimension without any selections and in all the years the value is same.In the previous file their is only 100 for all the years now i have updated the file with different values now you can find the issue.Please review the below file once.