Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi People,
can any one have the idea about achieve an chart expression in script editor itself?
below is the expression which i would like to get in the script itself.
(sum({<VersDesc = {'Adjust','Actual'},SalTypKey={'1'},SalPer = {1},Year=p(Year),Month={'*'},
Cal_Mon={'<=$(=max(Cal_Mon))'},CPTeaFlag={'CP','RPL','ORG'},DayNumInMon = {'<=$(=max(DayNumInMon))'},DayofWeek=,RegDesc={'*'},ACode=>}SalVal))/1000
)
/
count({<Month={'*'},Cal_Mon = {"<=$(=max(Cal_Mon))"},RegDesc={'*'},ACode=>}DISTINCT (FName))
/
count({<Month={'*'},Cal_Mon = {"<=$(=max(Cal_Mon))"},RegDesc={'*'},ACode=>}DISTINCT (Month))),'#,##0')
Can you guys help me how can i achieve this.... ??
Regards
Hemanth
Is there any specific reason to do it in script?
yeah there is reason the values are constant when i get into the chart and it wont change whenever a slection is done...
I did not understand "the values are constant when i get into the chart"
"and it wont change whenever a slection is done" -> Your data model is associative so, whatever selection you do, chart will reflect the values based on selection
Not entirely sure what you are trying to achieve - is it just a case of maintaining the expression in the script? If so, then just create the expression as a variable, then call it from your expression dialogue box:
SET myExpression = sum({<country=>}Transactions);
Expression: $(myExpression)
Is this what you mean?
Exactly the data model is associative, whatever the selection i do the chart will reflection the values based on selection.
But my point of view is that the values should be constant whatever the selection i do. so that if i get this calculation in the script editor itself then the values are constant whatever the selection i made in the dashboard
can u give me a example....?? . so that i can understand in clear
If you want to keep a static/Constant table then I suggest ValueList.
Sure, in your script, just add this:
SET myExpression = sum({<country=>}Transactions);
Then in the expression window of your object:
You can then go one step further and create all of your expressions as variables and maintain them in an external CSV or Excel. Here's a link to some script I wrote to show you how to then process all that into variables: A QlikView and QlikSense script to generate variables from a CSV include. · GitHub
best regards
George
its not working george.. actually my aim of doing this for my role base security.
for example the above expression will give a value as 500 for whole india (Banglore, delhi, chennai, mumbai, hyderabad).
when i give role base security it splits according to the role base security like banglore =100, delhi =100, chennai =100, mumbai= 100 , hyderabad=100.
But what i would like to show is whatever my role based security still my expression has to show 500 but not 100