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: 
Anonymous
Not applicable

Expression working on a chart until I sort the dimension

I have the following expression:

max({1<Year={$(#=vCurrentYear)}, MonthNumber={$(#=vCurrentMonth)}>} MonthlyTarget) // Monthly target

*

(

Sum({1<TimeIsland.Year={$(#=vCurrentYear)}, TimeIsland.MonthNumber={$(#=vCurrentMonth)}, TimeIsland.DayNumber={"<=$(#=vCurrentDay)"}>}TimeIsland.IsShopDay_Int) // Days in month so far

/

Sum({1<TimeIsland.Year={$(#=vCurrentYear)}, TimeIsland.MonthNumber={$(#=vCurrentMonth)}>}TimeIsland.IsShopDay_Int) // Days in month

)

This gets the monthly target for the user, and multiplys it by the number of shop days we've had in the month, divided by the total shop days in the month.

This works nicely providing I don't sort by my User dimension.

If I sort by text A-Z by the user dimension it doesn't show that bar.

I've norrowed it down to the Days in month so far and Days in month parts not getting calculated correctly.

Has anyone encountered anything like this before? It seems very odd to me that sorting a dimension effects the result.

I'm very new to QlikView so I'm probbaly missing something about how QlikView expressions work within charts etc.

Thanks,

George

1 Solution

Accepted Solutions
Not applicable
Author

I guess it might be the issue that u have the expression named as the variable in the script, i mean "MonthlyTarget". Try to change the label of expression.

View solution in original post

5 Replies
Not applicable
Author

Can u show the qvw file?

Anonymous
Not applicable
Author

Could I upload it without data? How do I do that?

Not applicable
Author

Open qlikview desktop with a Start page. Choose recently opened documents and with the right click "open without data".

Anonymous
Not applicable
Author

See attached.

Not applicable
Author

I guess it might be the issue that u have the expression named as the variable in the script, i mean "MonthlyTarget". Try to change the label of expression.