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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Set formula with GetFieldSelections()

Hello,

I would like to do a difference when a criteria is equal to an other field.

I have two field of Date:

Capture.PNG

And when the field "Date" is equal to one of the data in the field "Value Date", this operation have to be done:

=Sum({<AsOf = , [AIR Import Data] = {"=GetFieldSelections(AsOF)"}>} Value_AIR)/1000000

- SUM({$<source = {'Costs_PC'}>}myVal) - SUM( { $< source = {'FTE_Activity'}>}myVal)/

SUM( TOTAL { 1< source = {'FTE_Activity'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)*

SUM( TOTAL { 1< source = {'Allocated_Costs'}, AsOf = {"=$(=GetFieldSelections(AsOf))"} >}myVal)


But this part doen't work:

Sum({<AsOf = , [AIR Import Data] = {"=GetFieldSelections(AsOF)"}>} Value_AIR)/1000000


And i need to precise this parameter because it will sum all the data of Value_AIR for all AsOf.


How can i do that please ?


Thanks you in advance for your help,

Sébastien.

PS: AsOF is the name of the field 'Date' and AIR Import Data is the name of 'Value Date'

17 Replies
sunny_talwar

Not sure I understand the reason for using this?

AsOf = {"=$(=GetFieldSelections(AsOf))"}

Can you try to replace this with :

AsOf = p(AsOf)

CELAMBARASAN
Partner - Champion
Partner - Champion

Try with Intersect operator (*), check the below expression

Sum({<AsOf = , [AIR Import Data] *= {"=GetFieldSelections(AsOF)"}>} Value_AIR)

OR

Sum({<AsOf = , [AIR Import Data] *= P(AsOF)>} Value_AIR)

Anonymous
Not applicable
Author

Thanks it works !

But now I want to simplify the field of Date

Can i create a field which will be the intersection of theses two fields ?

Sébastien

Kushal_Chawda

I did not get you. Can you elaborate?

Anonymous
Not applicable
Author

Because Now i have two fields for Date here (Date and Value Data):

Capture.PNG

How can i simplify this into one field which will be the intersection of the Date present in theses two fields.

Thanks in advance,

Sébastien.

Kushal_Chawda

try this


Sum({<AsOf = , [AIR Import Data] *= {"= [AIR Import Data]=AsOf "}>} Value_AIR)/1000000

Anonymous
Not applicable
Author

Yes, i'm ok with this .

But it is possible to create an other Table Like 'Date' which will be the intersection between the Date from 'Date' (named 'AsOF' into the Script) and 'Value Date' (named 'AIR Data Import' into the script).

Sébastien.

Kushal_Chawda

Yeah for that you can see this

Canonical Date