Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
smilingjohn
Specialist
Specialist

Exprsion

Hi Iam using the below expression . which has an error

I know that in set analysis we cannot use left side a variable  , but is there any other wat to handle this ? because this is giving me an error . please find the  screen shot Eprsn.PNG

Count(

  {$<

  $(vBS_Sales_Map_Left) = $(vBS_Sales_Map_Right),

  Hierarchy = P(Hierarchy_S),

  Date = {">=$(StartDate)<=$(EndDate)"}

  >} Dummy_Closed_Sale_Lead_UID_AllCat_Count_LSM

  )

  ,

  Count(

  {$<

  $(vBS_Dashboard_Sales_Left) = $(vBS_Dashboard_Sales_Right),

  Hierarchy = P(Hierarchy_S),

  Date = {">=$(StartDate)<=$(EndDate)"}

  >} Dummy_Closed_Sale_Lead_UID_AllCat_Count_LSM

  )

)

can some one please rectify this...

1 Solution

Accepted Solutions
avinashelite

You could try like this

LOAD * inline

[

Current_Level,vBS_Sales_Map_Left,vBS_Dashboard_Sales_Left

5,S_O,S_O

3,District_S_O,District_S_O

2,District_S_O,Region_S_O

4,Region_S_O,S_O

1,Region_S_O,S_O

];

So automatically the fields will get linked in the model , so now you can replace the left hand side with the new field names created in the script i.e vBS_Sales_Map_Left,vBS_Dashboard_Sales_Left

View solution in original post

5 Replies
avinashelite

try creating the vBS_Dashboard_Sales_Left values in the script as a calculated field or a inline table and then you could use the same in the front end

smilingjohn
Specialist
Specialist
Author

Hi Avinash , again the contenet with the variables is a variable which has conditions , which cannot be written in the script , Is there no other way to manipulate this expression ?

avinashelite

could you please share the expression you have written in the variables ??

smilingjohn
Specialist
Specialist
Author

Thanks Avinash ,

This is the expression under the variable  " $(vBS_Sales_Map_Left)   "

=

if

(

  Current_Level = 5, 

  'S_O',

  if

  (

  Current_Level = 3,

'District_S_O',

  if

  (

  Current_Level = 2,

  'District_S_O',

  'Region_S_O'

  )

  )

)

And expression under " $(vBS_Dashboard_Sales_Left) "

=

if

(

  Current_Level = 5,

  'S_O',

  if

  (

  Current_Level = 3,

  'District_S_O',

  if

  (

  Current_Level = 2,

  'Region_S_O',

  'S_O'

  )

  )

)

Both the variables have almost same expression

avinashelite

You could try like this

LOAD * inline

[

Current_Level,vBS_Sales_Map_Left,vBS_Dashboard_Sales_Left

5,S_O,S_O

3,District_S_O,District_S_O

2,District_S_O,Region_S_O

4,Region_S_O,S_O

1,Region_S_O,S_O

];

So automatically the fields will get linked in the model , so now you can replace the left hand side with the new field names created in the script i.e vBS_Sales_Map_Left,vBS_Dashboard_Sales_Left