Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Karim_Khan
Creator III
Creator III

~ exclude how it will work in expression

HI Team,

I wanted to exclude the Sales level 2  value from my Expression but its not working.

=sum({$<~[Sales Level 2]={$(vSel2)},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])

Regards,

KK

KK
13 Replies
sasiparupudi1
Master III
Master III

try like this

=sum({$<[Sales Level 2]-={$(vSel2)},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this,

=sum({$<[Sales Level 2]=,[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])


This will not consider the Sales Level 2 for the calculation even if you have made any selection for that field.


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
tresesco
MVP
MVP

Try '-' for exclusion like:

<[Sales Level 2] - ={$(vSel2)}

Karim_Khan
Creator III
Creator III
Author

still showing the same error

KK
Karim_Khan
Creator III
Creator III
Author

Hi Kaushik,

I wanted to achieve below Data I was trying to

  I wanted to show the  Total of the current [Sales Level 1 ] and at the end it should show the sum of All [Sales Level 1].

I will pass the selection on [Sales Level 2].Am able to calculate the first two field.But I am unable to get the %.

Sales Level 2Customer CountBookings% BookingsAvg Deal Size
Total7424222457000.89.41%33225.42844
CANADA63120932019.929.41%33225.42844
LATIN AMERICA74129788670.259.41%33225.42844
US COMMERCIAL409858816212.469.41%33225.42844
US ENTERPRISE549517371379.41%33225.42844
US OTHER35475872.929.41%33225.42844
US PS MARKET SEGMENT140255707088.249.41%33225.42844

As per above Table am able to calculate Customer Count and Bookings.Now I want % Bookings which should show correctly as per

Calculation.

Bookings=Total/Sales Level 2

But its capturing only CANADA value in all Field which is wrong.I want the correct % Bookings value for remaining sales Level 2 also.

E.g :

If I select [Sales Level 1 ]  AMERICAS.Then it should show the calculated % bookings value for [Sales Level 2 ]  in the above table.

Trying to use expression


=sum({$<~[Sales Level 2]={$(vSel2)},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])

Regards,

KK

KK
Karim_Khan
Creator III
Creator III
Author

I wanted to achieve below Data I was trying to

  I wanted to show the  Total of the current [Sales Level 1 ] and at the end it should show the sum of All [Sales Level 1].

I will pass the selection on [Sales Level 2].Am able to calculate the first two field.But I am unable to get the %.

Sales Level 2Customer CountBookings% BookingsAvg Deal Size
Total7424222457000.89.41%33225.42844
CANADA63120932019.929.41%33225.42844
LATIN AMERICA74129788670.259.41%33225.42844
US COMMERCIAL409858816212.469.41%33225.42844
US ENTERPRISE549517371379.41%33225.42844
US OTHER35475872.929.41%33225.42844
US PS MARKET SEGMENT140255707088.249.41%33225.42844

As per above Table am able to calculate Customer Count and Bookings.Now I want % Bookings which should show correctly as per

Calculation.

Bookings=Total/Sales Level 2

But its capturing only CANADA value in all Field which is wrong.I want the correct % Bookings value for remaining sales Level 2 also.

E.g :

If I select [Sales Level 1 ]  AMERICAS.Then it should show the calculated % bookings value for [Sales Level 2 ]  in the above table.

Trying to use expression


=sum({$<~[Sales Level 2]={$(vSel2)},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])

KK
Karim_Khan
Creator III
Creator III
Author

I wanted to achieve below Data I was trying to

  I wanted to show the  Total of the current [Sales Level 1 ] and at the end it should show the sum of All [Sales Level 1].

I will pass the selection on [Sales Level 2].Am able to calculate the first two field.But I am unable to get the %.

Sales Level 2Customer CountBookings% BookingsAvg Deal Size
Total7424222457000.89.41%33225.42844
CANADA63120932019.929.41%33225.42844
LATIN AMERICA74129788670.259.41%33225.42844
US COMMERCIAL409858816212.469.41%33225.42844
US ENTERPRISE549517371379.41%33225.42844
US OTHER35475872.929.41%33225.42844
US PS MARKET SEGMENT140255707088.249.41%33225.42844

As per above Table am able to calculate Customer Count and Bookings.Now I want % Bookings which should show correctly as per

Calculation.

Bookings=Total/Sales Level 2

But its capturing only CANADA value in all Field which is wrong.I want the correct % Bookings value for remaining sales Level 2 also.

E.g :

If I select [Sales Level 1 ]  AMERICAS.Then it should show the calculated % bookings value for [Sales Level 2 ]  in the above table.

Trying to use expression


=sum({$<~[Sales Level 2]={$(vSel2)},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={$(vSel1)}>} [Net Bookings])

KK
sasiparupudi1
Master III
Master III

what is the error you are getting and what are the values in your variables?

may be you can try

sum({$<[Sales Level 2]-={'$(vSel2)'},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={'$(vSel1)'}>} [Net Bookings])

or try hardcoding your variable values in the expression and see if it returns values

sum({$<[Sales Level 2]-={'Some value'},[Fiscal Year] = {$(=only([Fiscal Year]))},[Month in Fiscal Year] = {'<=$(=only([Month in Fiscal Year]))'},CATEGORY={'IOT'},[Sales Level 1]={'Some Other value'}>} [Net Bookings])

also

if you put =only([Fiscal Year])  or  only([Month in Fiscal Year]) into a text object do you get a value?

Karim_Khan
Creator III
Creator III
Author

I am getting the red line error.Its showing error

KK