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

Issue with Calculated Dimension

Hi,

I'm facing an issue with my Line chart.

Below are the expressions which I'm providing

Calculated Dimension:

if(WeekStartDate>=$(v_StartRange) and WeekStartDate<$(v_EndRange),Week(WeekStartDate))

Variables I've declared as below

v_StartRange = Date(Max(WeekStartDate)-112,'MM/DD/YYYY') // I want to show 16 weeks data

v_EndRange = Date(Max(WeekStartDate),'MM/DD/YYYY')

It gives me Allocated memory Exceeded, but when i explicitly

Provides dates-----(if(WeekStartDate>='09/12/2016'and WeekStartDate<='01/02/2017',Week(WeekStartDate))), it is showing me the data.

And my Expression: sum {<SN={'LS*'}>} Volume)

Can anyone help me.

Thanks,

Sindhu

4 Replies
sunny_talwar

Try this as your variables

v_StartRange = Date(Max(TOTAL WeekStartDate)-112,'MM/DD/YYYY') // I want to show 16 weeks data

v_EndRange = Date(Max(TOTAL WeekStartDate),'MM/DD/YYYY')

danielact
Partner - Creator III
Partner - Creator III

Are your variables being calculated while declaring them? To check, if you create a text box with value =v_StartRange, do you see a date, or the text of the variable?

If you see the text, it would explain the issue. You can't use a max function in a dimension without a Total, as stalwar1‌ suggested.

You can either change the variable with the TOTAL statement, or just add an equals sign at the beginning of your variable, so that the date is calculated before the variable is referenced. If it's declared in the script, see the differences between SET and LET - you'd want to use LET in this case.

Not applicable
Author

Hi,

I've created the variable in Variable overview.

It worked when I used Today function.

--Sindhu

Not applicable
Author

It worked when I gave the expression as below

=if(WeekStartDate>=Today()-126 and WeekStartDate<=Today(),Week(WeekStartDate)) in the dimension

Where as I gave a simple expression,while trying to handle at the dimension it self.

Thanks All for your suggestions.

--Sindhu